With the first floor complete and the flashback finished, for now, I had no choice but to tackle the upcoming ‘Reception’ floor and that meant putting together the transition between the stairs and implementing the method for relocating the player as he changes rooms (a room in GMS2 is kind of like a level).
The trick to moving between floors is to pass a variable that tells the player to move to a set location after he arrives in the new room. The problem is you can’t do this in one pass because the changes don’t take place until the next ‘step’ (game frame), so you have to set everything up and then trigger the actual relocation on the ‘Room Start’ event. This also leads to the camera having to pan from it’s previous location to the player’s new location which isn’t good at all. So I also needed to force the camera into a new position. And finally, apply the full-screen fade from the previous floor and fade the new floor in.
And so the player arrives in the next area.
Bear in mind that the section of the room you see above is the only part of the floor I’ve put together as this session was about getting the transition between rooms working correctly. As the game world is relatively open the player can also turn around and return to the previous floor. I suspect I will be adding a need for this at some point. For example, the player isn’t going to be spending much time at reception to start with but will need to return once they’ve completed the objectives in the basement.
Outside of the actual game build I’ve been back to the graph paper drawing board, as it were, sketching up the maps for the basement and the reception (as far as I need it at the moment). This is no easy task as it involves carefully positioning the various objectives to ensure that they can be completed without the player being blocked off – although certain situations will result in a ‘game over’ state – especially in the forthcoming sections.