1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 18:19:43 +01:00

Update oldxp/oldyp when screen wrapping

This is so it doesn't look like entities "zip" across the room.
This commit is contained in:
Misa 2020-04-28 16:44:31 -07:00 committed by Ethan Lee
parent f06ca9172a
commit a7b62d1098

View file

@ -941,11 +941,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 += 320; obj.entities[i].xp += 320;
obj.entities[i].oldxp += 320;
} }
else if (obj.entities[i].xp > 310) else if (obj.entities[i].xp > 310)
{ {
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 -= 320; obj.entities[i].xp -= 320;
obj.entities[i].oldxp -= 320;
} }
} }
} }
@ -961,11 +963,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].yp += 232; obj.entities[i].yp += 232;
obj.entities[i].oldyp += 232;
} }
else if (obj.entities[i].yp > 226) else if (obj.entities[i].yp > 226)
{ {
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].yp -= 232; obj.entities[i].yp -= 232;
obj.entities[i].oldyp -= 232;
} }
} }
} }
@ -983,11 +987,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 += 350; obj.entities[i].xp += 350;
obj.entities[i].oldxp += 350;
} }
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 -= 350; obj.entities[i].xp -= 350;
obj.entities[i].oldxp -= 350;
} }
} }
} }
@ -1079,12 +1085,14 @@ void gamelogic()
if (obj.entities[i].xp <= -10) if (obj.entities[i].xp <= -10)
{ {
obj.entities[i].xp += 320; obj.entities[i].xp += 320;
obj.entities[i].oldxp += 320;
} }
else else
{ {
if (obj.entities[i].xp > 310) if (obj.entities[i].xp > 310)
{ {
obj.entities[i].xp -= 320; obj.entities[i].xp -= 320;
obj.entities[i].oldxp -= 320;
} }
} }
} }