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

Interpolate gravitron square indicators

This is more future-proofing than anything else. The position of the
indicators is just the x-position of the gravitron square divided by 10,
but the gravitron squares will always only ever move at 7 pixels per
frame - so the distance an indicator travels on each frame will only
ever be at most 1 pixel. But just in case in the future gravitron
squares become faster than 10 pixels per frame, their indicators will be
interpolated as well.
This commit is contained in:
Misa 2021-06-11 22:20:06 -07:00
parent 96660cd235
commit 37fd24bd85

View file

@ -2033,7 +2033,7 @@ void Graphics::drawentity(const int i, const int yoff)
{ {
if (obj.entities[i].xp < -100) if (obj.entities[i].xp < -100)
{ {
tpoint.x = -5 + (int(( -obj.entities[i].xp) / 10)); tpoint.x = -5 + (int(( -xp) / 10));
} }
else else
{ {
@ -2056,7 +2056,7 @@ void Graphics::drawentity(const int i, const int yoff)
{ {
if (obj.entities[i].xp > 420) if (obj.entities[i].xp > 420)
{ {
tpoint.x = 320 - (int(( obj.entities[i].xp-320) / 10)); tpoint.x = 320 - (int(( xp-320) / 10));
} }
else else
{ {