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

Chapter 8. Let's Build a Platformer!

Now that we're familiar with handling input and assets, why don't we build a platformer prototype? This should be a nice challenge that will introduce us to some more concepts and ways to work with Moai SDK.

In order to build this game, we'll copy the full content of the previous chapter's code and clean everything from game.lua that is specific to the Concentration game.

  • Remove all the constants on the top of the file, the definition for the tile (but keep resource_definitions since we're going to use it).
  • Remove self.wasClicking = false from the Game:start () method.
  • Remove the calls to initializeTiles and restartGamePlay from Game:initialize ().
  • Remove the methods Game:initializeTiles(), Game:restartGamePlay ...

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