mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-10 19:09:45 +01:00
Fix ZZT centipedes (or ASCII snakes) zipping around
This is because their oldxp wasn't being updated when they move (or rather, teleport) and wrap around the screen. These enemies are ZZT centipedes, but they're referred to as ASCII snakes in comments in the code.
This commit is contained in:
parent
82a7ff0357
commit
91468542a9
2 changed files with 4 additions and 0 deletions
|
@ -2376,6 +2376,7 @@ bool entityclass::updateentities( int i )
|
||||||
{
|
{
|
||||||
entities[i].statedelay = 6;
|
entities[i].statedelay = 6;
|
||||||
entities[i].xp -= int(entities[i].para);
|
entities[i].xp -= int(entities[i].para);
|
||||||
|
entities[i].oldxp -= int(entities[i].para);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 18: //Special for ASCII Snake (right)
|
case 18: //Special for ASCII Snake (right)
|
||||||
|
@ -2383,6 +2384,7 @@ bool entityclass::updateentities( int i )
|
||||||
{
|
{
|
||||||
entities[i].statedelay = 6;
|
entities[i].statedelay = 6;
|
||||||
entities[i].xp += int(entities[i].para);
|
entities[i].xp += int(entities[i].para);
|
||||||
|
entities[i].oldxp += int(entities[i].para);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1022,11 +1022,13 @@ void gamelogic()
|
||||||
{
|
{
|
||||||
if (obj.entities[i].isplatform) obj.removeblockat(obj.entities[i].xp, obj.entities[i].yp);
|
if (obj.entities[i].isplatform) obj.removeblockat(obj.entities[i].xp, obj.entities[i].yp);
|
||||||
obj.entities[i].xp += 400;
|
obj.entities[i].xp += 400;
|
||||||
|
obj.entities[i].oldxp += 400;
|
||||||
}
|
}
|
||||||
else if (obj.entities[i].xp > 320)
|
else if (obj.entities[i].xp > 320)
|
||||||
{
|
{
|
||||||
if (obj.entities[i].isplatform) obj.removeblockat(obj.entities[i].xp, obj.entities[i].yp);
|
if (obj.entities[i].isplatform) obj.removeblockat(obj.entities[i].xp, obj.entities[i].yp);
|
||||||
obj.entities[i].xp -= 400;
|
obj.entities[i].xp -= 400;
|
||||||
|
obj.entities[i].oldxp -= 400;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue