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 theGame:start ()
method.Remove the calls to
initializeTiles
andrestartGamePlay
fromGame:initialize ()
.Remove the methods
Game:initializeTiles()
,Game:restartGamePlay ()
,Game:choseCell ()
,Game:alreadySelectedTile()
,Game:swapTile ()
,Game:resetTiles ()
, andGame:removeTiles()
.
That should be it; now you should be good to go.