O'Reilly logo

Killer Game Programming in Java by Andrew Davison

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required