Time for action — finalizing the OnCreate method

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 the game class, add calls to our previously created methods LoadSounds, CreateLayers, CreateGameScreen, and CreateTitleScreen:
    atlas = LoadImage("CR_Tiles.png")
    font1 = eng.LoadFont("cr_font")
    LoadSounds()
    CreateLayers()
    CreateGameScreen()
    CreateTitleScreen()
    Return 0
    End
    

What just happened?

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.202.167