A lot of the
features that were mentioned in my initial design have now been implemented and
now seemed like the appropriate time to add the win conditions. These win
conditions meant adding a timer in game. I experimented with this timer, such
as its size, positioning and different colouring. I settled on reducing the
size of the milliseconds, and only displaying the appropriate values as
necessary i.e. only displaying hours once the Player had been playing for more
than one hour.
The win
condition for this game was to add the ‘Motherload’, a golden block which is
considered to be extremely valuable! Once the Player has collected this, a
prompt is added one screen instructing the Player to visit the shop in order to
turn it in. Turning this into the shop will end the game and transition the
Player to the win screen. This is just a simply screen which tells the Player
what their completion time was. This was a tricky solution to find as I didn’t
know how to carry data across scenes. The solution to my problem was using a
static variable which I found from the StackExchange
forum user (Çetin, 17) .
In his post he explained that the best way to carry data between scenes is to
store it on an object which isn’t destroyed when loading a new scene. This
object contains a script of static variables. These variables can be accessed
from any script without getting a specific reference to it, this is done by
calling [script name].[variable name]
which in my case, for example I would call PublicData.finalMinutes.
Once the Motherload has been handed in, before the new scene is loaded, the
timer is paused, and the time is passed from the timer to this script.