Home

Forum

Games

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

Chapter
Examples



Programming 2D Games

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

Bonus Examples

Spacewar v2.0

The Spacewar game using the ship model from the cover art by Nicholas R. Wilson and a ship model created in Blender by the author.

  • The game has a resolution of 1280x800.
  • The star is animated.

Spacewar 2.0

download......(Source included)

 

Asteroid Race

A game inspired from the book cover art. This is version 0.8. It is not a complete game.

  • The game has a resolution of 1280x800.
  • Demonstrates the use of sprite scaling to simulate 3D depth.
  • Ship model by Nicholas R. Wilson
  • Asteroid model created in Blender by the author

Asteroid Race

download......(Source included)

Texture Filter Demo

A 4x4 and 8x8 sprites are displayed. Move left and right with the arrow keys. Change scale with + -. Change the pixel sampling filter with F.

  • Demonstrates the effect different texture filters have when drawing sprites.
  • The right 8x8 sprite has a 1 pixel wide transparent border.

Texture Filter

Download......(Source included)

Gamepad Demo

Displays the state of the analog and button inputs on the currently connected controllers.

Gamepad Demo

Download......(Source included)

Particle Demo

Creates a ParticleEmitter class to display particles. The ParticleEmitter class supports the following:

  • The number of particles may be set.
  • The particles may collide with other objects.
  • Each particle may be animated.
  • The particle creation rate may be varied.
  • The particle Max and Min life may be set.

Particle Demo

download......(Source included)

Line Demo

Demonstration of the line drawing feature in v3.5 of the game engine. See graphics.h file for line drawing options.

Line Demo

Download......(Source included)

Maze Demo

Generates a random maze. The size of the maze is specified in  mazeDemo.h. Uses the line drawing feature in v3.6 of the game engine.

Maze Demo

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:

14 November, 2014