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()
Now, insert a call to CreateStars for 50 stars.
CreateStars(50)
Create the player and load the sounds.
CreatePlayer()
LoadSounds()
Before you create text objects, you need to load a bitmap font.
font1 = eng.LoadFont("cc_font")
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: