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

  1. Head over to our OnCreate method and add the call to CreateLayers.
    Method OnCreate:Int()
    SetUpdateRate(60)
    eng = New engine
    atlas = LoadImage("cctiles.png")
    CreateLayers()
    
  2. Now, insert a call to CreateStars for 50 stars.
    CreateStars(50)
    
  3. Create the player and load the sounds.
    CreatePlayer()
    LoadSounds()
    
  4. Before you create text objects, you need to load a bitmap font.
    font1 = eng.LoadFont("cc_font")
    
  5. Now, create all the text related objects.
    CreateInfoText()
    CreateTitleScreen()
    CreateHighScoreList()
    Return 0
    End
    

What just happened?

That's all. We have created several methods that will create our game objects. The OnCreate method is also set and done. No further changes are required. If you save the script ...

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