mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-10 19:09:45 +01:00
Fix animating entities' drawframes not being updated for 1 frame
What happens here is that the entity gets created and then gets immediately updated on the next frame, but there's no time for their walkingframe of 0 to be rendered, so it'll look like they have just started with walkingframe 1. However in the delta-timestep rendering it'll render with walkingframe 0. So we need to fix their drawframe and increment it when creating them.
This commit is contained in:
parent
b5b958561c
commit
eaf9eec3dc
1 changed files with 26 additions and 0 deletions
|
@ -2012,6 +2012,32 @@ void entityclass::createentity( float xp, float yp, int t, float vx /*= 0*/, flo
|
||||||
{
|
{
|
||||||
entity.updatecolour();
|
entity.updatecolour();
|
||||||
}
|
}
|
||||||
|
if (entity.type == 1)
|
||||||
|
{
|
||||||
|
switch (entity.animate)
|
||||||
|
{
|
||||||
|
case 0: // Simple Loop
|
||||||
|
case 1: // Simple Loop
|
||||||
|
case 2: // Simpler Loop (just two frames)
|
||||||
|
case 3: // Simpler Loop (just two frames, but double sized)
|
||||||
|
case 4: // Simpler Loop (just two frames, but double sized) (as above, but slower)
|
||||||
|
case 5: // Simpler Loop (just two frames) (slower)
|
||||||
|
case 6: // Normal Loop (four frames, double sized)
|
||||||
|
case 7: // Simpler Loop (just two frames) (slower) (with directions!)
|
||||||
|
case 11: // Conveyor right
|
||||||
|
entity.drawframe++;
|
||||||
|
break;
|
||||||
|
case 10: // Conveyor left
|
||||||
|
entity.drawframe += 3;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (entity.type == 2 && entity.animate == 2)
|
||||||
|
{
|
||||||
|
entity.drawframe++;
|
||||||
|
}
|
||||||
|
|
||||||
entities.push_back(entity);
|
entities.push_back(entity);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue