Today I have done three major things:
a) Scene transitions
b) Room layout and room transitions
c) Player capabilities and corresponding pickups
a) Scene transitions
To make it look a bit cooler when you switch between the main menu and the game (or teleport from one room to another), I am using post-processing stack v2 effects.
At the moment, those are taken from my other game and will be replaced by something more fitting if I have enough time.
You need to implement an interface that is managing the settings and the shader that is doing all the work on the screen image. Afterwards you can add it as your own effect to the post-process volume in the inspector and modify all shader values.
Afterwards I’m simply animating the “fade” property from 0 to 1 when fading out and backwards when fading in.
b) Room layout and room transition
The game will have a few floors with a few rooms each, so I added a MonoBehaviour
for each of those two types.
In the game scene, I have arranged the floors on top of each other and the rooms as children of those. For convenience, a layout function in the floor script positions the rooms in the editor. The room script also draws its bounds and the player start position (which is actually only needed for the start room).
The player controller has references to all floors and will load and prepare the adjacent room (at least I am prepared for this, but I guess with the current amount of gameobjects I will just keep all rooms loaded at all times) when the player walks out of the current one. A transition is triggered that holds the gameplay and moves the camera to the center of the new room.
c) Player capabilities and corresponding pickups
The player starts as a normal boy and cannot double jump or move the boxes. He can – surprisingly enough – not even teleport.
The player controller has a list of those capabilities and there are pickups that add those capabilities to the player. The pickups are another type of “touchables” in the game and future versions will include keycards or other items needed for puzzle solving as well.
To react to the new power (or tell you that he cannot move a box without it), I have added messages that are using the same letter movement system as the main menu.
I have also added the savegame mechanism, so if you exit the game or switch to the main menu, the player will return to his most recent position when you come back. And… if I did it correctly… all those boxes will appear at their most recent positions as well.