1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00

Maintain game.swnmode until all gravitron squares are offscreen

Today, I saw a video posted by Chelito on the VVVVVV speedrunning
Discord where he died inside a gravitron square over and over after the
Gravitron in Intermission 2 ended.

https://cdn.discordapp.com/attachments/234787368522088448/779074864660480020/What.mp4

This is caused by the fact that after the Gravitron ends, the game no
longer considers you to be inside swnmode, so it won't move the enemies
offscreen when you die.

To fix this, after the Gravitron ends, the game will switch to swngame
8, where it will keep you inside swnmode until all gravitron squares are
offscreen. This means that gravitron squares that are onscreen after the
Gravitron ends will be moved offscreen if you die, preventing the above
death loop from happening.
This commit is contained in:
Misa 2020-11-19 15:16:54 -08:00 committed by Ethan Lee
parent db0c38711c
commit 634a41d80d

View file

@ -788,8 +788,7 @@ void gamelogic()
if (obj.entities[line].xp > 320)
{
obj.removeentity(line);
game.swnmode = false;
game.swngame = 6;
game.swngame = 8;
}
}
}
@ -810,6 +809,22 @@ void gamelogic()
game.swncoldelay = 30;
}
}
else if (game.swngame == 8) //extra kludge if player dies after game a ends
{
bool square_onscreen = false;
for (size_t i = 0; i < obj.entities.size(); i++)
{
if (obj.entities[i].type == 23)
{
square_onscreen = true;
break;
}
}
if (!square_onscreen)
{
game.swnmode = false;
}
}
}
//Time trial stuff