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 — setting a tile slot ID

This method will take the slot positions and the gem ID and fill the tile map accordingly.

  1. Insert the method SetSlotTile into the game class. The parameters are column, row, and the gem ID. All are of the type INT.
    Method SetSlotTile:Int(column:Int, row:Int, gem:Int)
    
  2. Set the tile map according to the given parameters. Then, close the method.
    tileMap[column-1][row-1] = gem
    Return 0
    End
    

What just happened?

The last method allows you to set the slot ID of a tile/gem in the map easily.

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