mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-11 03:19:46 +01:00
Move onground/onroof/animateentities logic to start of gamelogic()
For some reason, it was put near the start of gamerender(), even though since it handles edge-flipping it seems like it should be in the logic function already. This makes sure entity animations don't animate as fast as possible, and also fixes edge-flipping on normal surfaces.
This commit is contained in:
parent
57b643d22a
commit
298aa95259
2 changed files with 28 additions and 28 deletions
|
@ -119,6 +119,34 @@ void gamecompletelogic2()
|
||||||
|
|
||||||
void gamelogic()
|
void gamelogic()
|
||||||
{
|
{
|
||||||
|
if (!game.blackout && !game.completestop)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < obj.entities.size(); i++)
|
||||||
|
{
|
||||||
|
//Is this entity on the ground? (needed for jumping)
|
||||||
|
if (obj.entitycollidefloor(i))
|
||||||
|
{
|
||||||
|
obj.entities[i].onground = 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
obj.entities[i].onground--;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (obj.entitycollideroof(i))
|
||||||
|
{
|
||||||
|
obj.entities[i].onroof = 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
obj.entities[i].onroof--;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Animate the entities
|
||||||
|
obj.animateentities(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Misc
|
//Misc
|
||||||
if (map.towermode)
|
if (map.towermode)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1348,34 +1348,6 @@ void gamerender()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!game.completestop)
|
|
||||||
{
|
|
||||||
for (size_t i = 0; i < obj.entities.size(); i++)
|
|
||||||
{
|
|
||||||
//Is this entity on the ground? (needed for jumping)
|
|
||||||
if (obj.entitycollidefloor(i))
|
|
||||||
{
|
|
||||||
obj.entities[i].onground = 2;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
obj.entities[i].onground--;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (obj.entitycollideroof(i))
|
|
||||||
{
|
|
||||||
obj.entities[i].onroof = 2;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
obj.entities[i].onroof--;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Animate the entities
|
|
||||||
obj.animateentities(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
graphics.drawentities();
|
graphics.drawentities();
|
||||||
if (map.towermode)
|
if (map.towermode)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue