The OnCreate
method in the game
class is the place where all static objects are defined.
1. Inside the
OnCreate
method of thegame
class, add calls to the methods you have created previously.font1 = eng.LoadFont("ts_font") tileMap = Create2DArray(columns,rows) LoadSounds() CreateLayers() CreateBackgroundScreen() CreateGameOverScreen() CreateMenuScreen() CreateScoreScreen() CreateTitleScreen()
2. To display the title screen later on, set the game mode to
gmTitle
, and active the layers with this mode.gameMode = gmTitle ActivateLayer(gameMode) Return 0 End
In the OnCreate
method, you have added the calls to other methods that will set up all the static objects we need for the game, such as sounds, layers, text objects, buttons, and so on.
If you build and run the game now, you should just see the title screen in its full glory. The switch to the menu screen will be implemented in the engine
class, later on.