Game Development Reference
[player updateVertexZ:tilePos tileMap:tileMap];
If you try this now, you'll see that the ninja player will hide behind walls, trees, and
other large objects, like a good ninja does.
Moving the Player, Tile by Tile
So far, the player (actually, the screen) moves faster the further away from the center
the screen is touched. The player also moves across the tiles freely, but he really should
be moving from tile to tile in only four directions. The IsoTilemap03 project changes
the control mechanism to one that allows you to move the player in one of the four al-
lowed directions as long as you keep a finger on the screen. The move direction de-
pends on where you touch the screen relative to the player.
Listing 11-6. The TileMapLayer Class Interface
MoveDirectionNone = 0,
@interface TileMapLayer : CCLayer
CGPoint playableAreaMin, playableAreaMax;
CGRect upperLeft, lowerLeft, upperRight, lowerRight;