In both events of the
OnRender, we will use a finite state machine (FSM) approach.
If you don't know what a finite state machine is, here is a link to a nice explanation:
An FSM does different things at anyone time, depending on which mode it is in. Consider the
OnUpdate method of a Monkey game. Let's say the mode is the 'start' of a new game. Through IF checks or SELECT statements, you would call different methods or functions, as compared to when the mode was set to 'play' the game.
And in our case, depending on our variable
gameMode, we will call different methods. It is one way of controlling and also structuring code. So, spice ...