An Isometric Tile Game

Páginas: 35 (8582 palabras) Publicado: 9 de mayo de 2012
Java Prog. Techniques for Games. Chapter 6.4. An Isometric Tile Game.

Draft #1 (4th May ‘04)

Chapter 6.4. 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 1).

Figure 1. AlienTiles in Action. The player is represented by a little blueman with a red cap in the center of the screen. Three of the four orange aliens are visible in Figure 1, although one of them is mostly hidden behind the black and white column just to the right of the player. 1. Background 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), although thetiling 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. It's 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 theterm ‘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 things (sprites, objects) drawn in the rows. An object on a row nearer the front is drawn after those on rows further back, hiding anything behind it. This is the case in Figure 1 with theblack and white column hiding the alien standing two rows behind it.

1

 Andrew Davison 2004

Java Prog. Techniques for Games. Chapter 6.4. An Isometric Tile Game.

Draft #1 (4th May ‘04)

There are various ways of labeling the x- and y- axes of a isometric tile map. We use the fairly standard staggered map approach illustrated in Figure 2.

Figure 2. A Staggered Isometric Tile Map. Oddand even rows are offset from each other, which means that the tile coordinates can be a little tricky to work out as a sprite moves between rows. AlienTiles uses tile coordinates to position sprites and other objects on the surface. However, the surface itself isn’t made from tiles, instead it's a single medium size GIF (216K), as shown in Figure 3.

Figure 3. The surface.gif Image. Mostisometric games construct the surface from individual tiles, which allows the floor space to be incrementally rendered, and to dynamically change over time. The drawback is the increased complexity (and time) in drawing the tiles to the screen. It is necessary to draw them in back-to-front row order, with each diamond represented by a rectangular GIF with transparent corners.

2

 Andrew Davison2004

Java Prog. Techniques for Games. Chapter 6.4. An Isometric Tile Game.

Draft #1 (4th May ‘04)

Often the surface will be a composite of several layers of tile of different sizes. For example, there may be several large green tiles for the terrain, layered over with smaller grass, dirt, and sand tiles to create variety. Fringe tiles are employed to break up the regularity of the edgesbetween two large areas, such as the land and the sea. 1.1. Movement AlienTiles offers four directions for a sprite to follow: north east, south east, south west, and north west, as in Figure 4.

Figure 4. Directions of Movement for a Sprite. The user interface maps these directions to the four corners of the numbers keypad: to the keys ‘9’, ‘3’, ‘1’, and ‘7’. It’s also possible to not move atall by pressing ‘5’. An obvious extension is to also offer north, east, south, and west movement. The range of directions is dictated by the tile shape to a large extent, and diamonds aren’t the only possibility. For instance, a number of strategy games use hexagons to form a Hex map (Figure 5), which allows six compass directions out of a tile.

Figure 5. A Hex Map.

3

 Andrew Davison...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Metodos de an lisis burs tiles
  • tilo
  • Tilo
  • El tilo
  • tilo
  • tilo
  • tilo
  • GAMA DE LA GAMA

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS