The OnCreate
method was previously created by you. But now you need to add the calls to the methods you have build over the last pages.
1. Inside the
OnCreate
method of thegame
class, add calls to our previously created methodsLoadSounds, CreateLayers, CreateGameScreen
, andCreateTitleScreen:
atlas = LoadImage("CR_Tiles.png") font1 = eng.LoadFont("cr_font") LoadSounds() CreateLayers() CreateGameScreen() CreateTitleScreen() Return 0 End
Now, we have set up the game objects, but not all, because the atom elements are missing. These will be set up dynamically during the update process and so can't be done in the OnCreate
event. This book comes with the complete source of the game. If you need to check against it, look in the chainreaction.monkey
file.