Game Development Reference
In-Depth Information
This World Deserves a Better End
Because of the diamond-shaped nature of isometric tilemaps, it's inevitable that the
scrolling tilemap will reveal parts outside of the tilemap, as shown in Figure 11-15 .
Indeed, the tilePosFromLocation method ensures that the returned tile coordin-
ate is always within bounds, so you can use that safely even if the player touches out-
side the tilemap. But if you don't want the player to see the end of your isometric
tilemap world, you'll have to use a trick.
Figure 11-15 . It's the end of the world as we know it (and it feels wrong)
Open Tiled and load the isometric.tmx file from the IsoTilemap01 project's Re-
sources folder. What you want to do is to add a border around the existing map and
fill it with tiles that give the impression of an impassable area. In Tiled, use Map
Resize Map … to bring up the Resize dialog shown in Figure 11-16 . You need to add
10 tiles to each side of this tilemap to completely fill the border. Depending on the tile
size, you'll have to experiment to find the minimum number of tiles that needs to be
appended. In this case, enter 50 as the new width and height and also enter 10 in the
offset boxes. This makes the tilemap 20x20 tiles larger and also moves everything
you've edited previously to the center so that you end up with a border of 10 tiles on
each side.
 
 
 
Search Nedrilad ::




Custom Search