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 now and let it run, you should see something similar to the following screenshot:

What just happened?
..................Content has been hidden....................

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