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 — modifying the OnCreate method

We need to set the update rate, create an instance of the ftEngine class from the fantomEngine, and load the texture (sprite sheet) that holds all the game graphics.

  1. Modify the OnCreate method by setting the update rate.
    Method OnCreate:Int()
    SetUpdateRate(60)
    
  2. Set the eng variable with an instance of our engine class.
    eng = New engine
    
  3. Load the texture atlas.
    atlas = LoadImage("cctiles.png")
    Return 0
    End
    

What just happened?

By modifying the OnCreate method, we now have access to the fantomEngine. Also, we will set the update rate of the game to 60 frames per second.

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