Techniques

[Raycasting] [Sprites] [Tiled backgrounds] [Voxels]

This page contains source code demonstrating techniques often used in game programming.

Raycasting example

Screen shot

A example program to demonstrate the process of ray-casting.
Note: This isn't the fastest, nor the best way to do ray-casting. These routines have intentionally been slowed down to improve readability.

To download the Pascal source code (5k), click here.
To download the DJGPP/C(++) source code (5k), click here.

Simple sprite routines

Sample source code on using sprites. This is a small demonstration which makes two sprites bounce around the screen.

To download the Pascal source code (2k), click here.
To download the DJGPP/C(++) source code (2k), click here.

Tiled backgrounds

Sample code to scroll a tiled background across the screen.

To download the Pascal source code (2k), click here.
To download the DJGPP/C(++) source code (2k), click here.

Voxel landscapes

Screen shot

Source code to display voxel landscapes as used in Comanche: Maximum Overkill .
Note: Again, this isn't the fastest, nor the best way to do voxels. These routines have intentionally been slowed down to improve readability.

To download the Pascal source code (72k), click here.
To download the DJGPP/C(++) source code (72k), click here.
To download the MSVC source code (72k), click here.