O'Reilly logo

Monkey Game Development by Michael Hartlef

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required