Chapter 13. An Isometric Tile Game

AlienTiles is a basic isometric tile game consisting of one player who must pick up a cup, flower pot, and a watch before four nasty aliens catch and hit him three times (see Figure 13-1).

AlienTiles in action
Figure 13-1. AlienTiles in action

The player is represented by a little blue man with a red cap in the center of the screen. The orange aliens (with red hair) are a bit easier to see in Figure 13-1, though one is mostly hidden by the black and white column just to the right of the player, and two of the aliens are momentarily occupying the same tile, so one is obscured.

Isometric Tiles

Isometric tiles are the basis of many real-time strategy (RTS) games, war games, and simulations (e.g., Civilization II, Age of Empires, and SimCity variants), though the tiling of the game surface is usually hidden.

Isometric tiles give an artificial sense of depth as if the player’s viewpoint is somewhere up in the sky, looking down over the playing area. Of course, this view is artificial since no perspective effects are applied; the tiles in the row “nearest” the viewer are the same size and shape as the tiles in the most “distant” row at the top of the screen. This is where the term isometric comes from: an isometric projection is a 3D projection that doesn’t correct for distance.

The illusion that each row of tiles is further back inside the game is supported by the z-ordering of ...

Get Killer Game Programming in Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.