mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 18:19:43 +01:00
Make player not suddenly stop when screen transitioning
This was especially noticeable in slowmode, where after going to an adjacent room, it would look like they stopped for a split second. This commit makes it so they smoothly continue their journey after switching rooms. The integer cast is to round off any fractional part of the velocity so that they don't make a difference and result in the oldxp/oldyp being one pixel off. Especially since the player's y-velocity fluctuates while standing unflipped on the floor. Incidentally enough, this seems to only have been a problem with screen transitions for some reason. No other uses of gotoroom() (such as the one where gotoroom() is called every other frame, or every frame) seem to have resulted in this "pausing" behavior, or at least a reversion back to 30 FPS movement. I don't know why.
This commit is contained in:
parent
9256b4da56
commit
df2d8e881e
1 changed files with 2 additions and 2 deletions
|
@ -1040,8 +1040,8 @@ void mapclass::gotoroom(int rx, int ry)
|
||||||
temp = obj.getplayer();
|
temp = obj.getplayer();
|
||||||
if(temp>-1)
|
if(temp>-1)
|
||||||
{
|
{
|
||||||
obj.entities[temp].oldxp = obj.entities[temp].xp;
|
obj.entities[temp].oldxp = obj.entities[temp].xp - int(obj.entities[temp].vx);
|
||||||
obj.entities[temp].oldyp = obj.entities[temp].yp;
|
obj.entities[temp].oldyp = obj.entities[temp].yp - int(obj.entities[temp].vy);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < obj.entities.size(); i++)
|
for (size_t i = 0; i < obj.entities.size(); i++)
|
||||||
|
|
Loading…
Reference in a new issue