We have have three game modes. Two of them, gmMenu
and gmGameOver
, are modes where some kind of menu or text is displayed. The third mode, gmPlay
, is for rendering and updating the actual game play.
1. Add a
Select
statement to theOnUpdate
method.Method OnUpdate:Int() Select gameMode
2. Depending on whether
gameMode
isgmMenu
orgmOver
, we will call a new methodUpdateMenu
.Case gmMenu, gmGameOver UpdateMenu()
3. When
gameMode
is equal togmPlay
, call another new method calledUpdateGame
.Case gmPlay UpdateGame()
4. Close the
Select
statement.End End
5. Now, add the bodies of the formerly mentioned methods,
UpdateMenu
andUpdateGame
. InsideUpdateMenu
, we will also add an IF statement to act differently, depending on the game mode.Method UpdateMenu:Int() If gameMode = gmMenu 'we will add code here later Else 'Code that runs when gameMode = gmGameOver Endif Return True End Method UpdateGame:Int() Return True End