Reuzentranen (Giant’s Tears)
This game is built using entirely 2D assets but using a perspective view. Making the gameworld a believable, traversable space. Reuzentranen is designed to be an interactive, linear storytelling game. Players follow the main-character through a series of events.
For this game I built a phase system used in multiple games. The game starts with an introduction sequence where the camera zooms in through a layer of leaves. I used a sprite shader which writes to the depth buffer so I could apply a depth of field post process effect. This depth of field effect is used throughout the game.
The next sequence has the players jump from leaf to leaf to reach the next dry ‘land’. Leaves freeze when stepped on to help the players cross.
Leaves are pooled, meaning when a leaf exits the screen it is reset to the top; pooling is used to keep performance steady.
Below is a code sample of how the leaves handle collision with the player and with one another. Leaves boost through each other, but stop for a player. I have chosen this snippet because it solves a few design problems regarding interaction with the leaves.
Afterwards the players move onto the climbing scene. Here they climb up into a tree, following the main characters instructions. Depth of field is also used here to convey the feeling of height. Whenever the main character moves it is using a waypoint system I built. Waypoints are placed in the Unity editor. For each waypoint you can choose the animation you want to play (e.g. running, crawling).
The waypoint system and scene setup with perspective and depth of field in action.
One of the requirements of all the linear games we’re building is that every chapter can be skipped & restarted. For this reason I’ve built a phase system which controls the flow of the game. Every chapter (defined by the designer) is programmed as a phase. Phases have a Reset method, a Start method and an End method. Every phase implements this abstract phase class.
- With the ResetPhase method you make sure all objects are set to their initial state needed to start the phase.
- With the StartPhase method you first call ResetPhase after which you can start the implemented sequences a phase runs through.
- At the end of the phase you call the EndPhase method which fires the event OnPhaseCompleted. The PhaseController handles this event, makes sure the next phase starts (if there is one) and cleans up.
I used this phase system for all linear games that I’ve build which is three in total.