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 — first changes to the OnCreate method

  1. First store the size of the canvas in the fields cw and ch.
    Method OnCreate:Int()
    SetUpdateRate(60)
    eng = New engine
    cw = eng.canvasWidth
    ch = eng.canvasHeight
    
  2. Now, load the sprite sheet.
    atlas = LoadImage("ts_Tiles.png")
    
  3. Then, load the game font file.
    font1 = eng.LoadFont("ts_font")
    
  4. Next, set up the array to store the game grid.
    tileMap = Create2DArray(columns,rows)
    Return 0
    End
    

What just happened?

Besides setting up the array, this was business as usual.

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