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 authored and Ethan Lee committed 2020-06-19 09:05:48 -04:00
1 parent 82a7ff0357
commit 91468542a9
2 files changed
+4

No files matched your search

+2
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