Game Development Reference
In-Depth Information
Figure 11-17 . A convincing impassable map border area
Note The impassable area in Figure 11-17 does look quite repetitive and bor-
ing. You may be tempted to add more detail to that area, but that's a double-
edged sword. On one side, more details and variations within the impassable
area will make it look better. On the other, it can also fool the player into think-
ing about and, even worse, spending time trying to reach that one spot in the
impassable area that looks like it could be visited. For example, houses or cave
entrances are places the player would want to explore, so avoid using those in
the border area. The player might assume it's a secret area and he simply has to
figure out how to get there. If you have a player thinking like this, it's bad for
your game. You don't want to tempt the player into trying things that are abso-
lutely impossible to achieve. It just wastes his time and it ends in frustration.
The IsoTilemap02 project implements the code that prevents you from scrolling out-
side the playable area by defining the inner tile coordinates of the playable area. I ad-
ded two CGPoint variables, playableAreaMin and playableAreaMax , to the
TileMapLayer class:
@interface TileMapLayer : CCLayer
CGPoint playableAreaMin, playableAreaMax;
The playable area variables are initialized with a border size of 10 tiles in the init
method of the class:
Search Nedrilad ::

Custom Search