Home

Forum

Games

~~~~~~~~~~~~~

Chapter
Examples



Programming 2D Games

Official site of "Programming 2D Games" the book
by: Charles Kelly

Chapter 10 Tiled Games

Flower Power

A butterfly flies over grass and flowers.

  • Demonstrates a tile based game using orthogonal projection.
  • The butterfly is controlled by the player.
  • The map scrolls when the butterfly reaches the screen edge.

Flower Power

download......(Source Included)

Flower Power 3.0 (Bonus)

Vertical scrolling is supported. Collision between butterfly and post.

  • Demonstrates a tile based game using orthogonal projection.
  • The butterfly is controlled by the player.
  • The map scrolls when the butterfly reaches the screen edge.
  • Demonstrates using Entity collision in a tile based game.

Flower Power

download......(Source Included)

Oblique Projection

A checkerboard is drawn using oblique projection.

  • Demonstrates oblique projection.
  • The checkers have a reflection.
  • The board and checkers are drawn from back to front.

Oblique

download......(Source included)

Isometric Diamond

A checkerboard is drawn using isometric projection.

  • Demonstrates isometric projection.
  • The checkers have a reflection.
  • The board and checkers are drawn from back to front.

Isometric Diamond

Download......(Source included)

Isometric Stagger

A checkerboard is drawn using isometric projection with the tiles drawn in a grid pattern.

  • Demonstrates isometric projection.
  • Demonstrates how to position the tiles to form different patterns.
  • Different row and column drawing orders may be selected.

Isometric Stagger

download......(Source Included)

Isometric Elevations

A terrain map is drawn using isometric projection.

  • Demonstrates isometric projection.
  • The tiles are drawn to represent different elevations.
  • Demonstrates how to incorporate third party tile sets.

Isometric Elevations

download......(Source included)

download (Bonus)......(The map data is loaded from an external file. Source included)

Isometric Elevations Layers

A terrain map is drawn that uses multiple map layers.

  • Demonstrates isometric projection.
  • Multiple map layers permits structures that are taller than one tile.

Isometric Elevations Layers

Download......(Source included)

Tile Collision (Bonus)

A boat may be driven through a scrolling tile map. The boat collides with the tiles.

  • Demonstrates using an Entity object to perform tile collision tests.
  • The tile map is loaded from an external file.
  • Zoom in and out with +/- keys.

Tile Collision

download......(Source Included)

Isometric Selection (Bonus)

The checker moves to the selected square.

  • Demonstrates isometric selection.
  • The selection code is located in checkers.cpp

Isometric Selection

Download......(Source included)

   


Creative Commons License
Programming 2D Games Examples by Charles Kelly are licensed under a Creative Commons Attribution 3.0 Unported License.

 

This website copyright © 2012 by Charles Kelly, All Rights Reserved

Last Updated:

07 October, 2013