O'Reilly logo

Developing Mobile Games with Moai SDK by Francisco Tufro

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

Main character

In order to create our character, we'll need a sprite sheet with animations for walking, running, and jumping.

It should look something like the following image:

Main character
  1. First of all, we'll create a resource definition as follows (put this below the background resource definition):
      character = {
        type = RESOURCE_TYPE_TILED_IMAGE,
        fileName = 'character/character.png',
        tileMapSize = {20, 6},
        width = 64, height = 64,
      }

    This is pretty much the same as we used for our Concentration game, but note that we added width and height. That's the size of the tile. In the Concentration game, we defined the size of the tile in the grid, but now there is no ...

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