1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-25 05:58:30 +02: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:
Misa 2020-05-01 17:40:14 -07:00 committed by Ethan Lee
parent 82a7ff0357
commit 91468542a9
2 changed files with 4 additions and 0 deletions

View File

@ -2376,6 +2376,7 @@ bool entityclass::updateentities( int i )
{
entities[i].statedelay = 6;
entities[i].xp -= int(entities[i].para);
entities[i].oldxp -= int(entities[i].para);
}
break;
case 18: //Special for ASCII Snake (right)
@ -2383,6 +2384,7 @@ bool entityclass::updateentities( int i )
{
entities[i].statedelay = 6;
entities[i].xp += int(entities[i].para);
entities[i].oldxp += int(entities[i].para);
}
break;
}

View File

@ -1022,11 +1022,13 @@ void gamelogic()
{
if (obj.entities[i].isplatform) obj.removeblockat(obj.entities[i].xp, obj.entities[i].yp);
obj.entities[i].xp += 400;
obj.entities[i].oldxp += 400;
}
else if (obj.entities[i].xp > 320)
{
if (obj.entities[i].isplatform) obj.removeblockat(obj.entities[i].xp, obj.entities[i].yp);
obj.entities[i].xp -= 400;
obj.entities[i].oldxp -= 400;
}
}
else