O'Reilly logo

Beginning 3D Game Programming by Tom Miller

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

Implementing the Ammunition Class

Although tanks firing huge missiles with a lot of explosions everywhere is probably what you're used to seeing in a game (or movie), you can make this implementation simpler. Your bullets can be small bouncing pellets because, after all, I'm sure you don't want to promote violence! What you need now is an implementation.

Continuing with the theme in Tankers, you create a new code file for the “bullet” class. The included CD calls the file bullet.cs, and the initial implementation appears in Listing 15.1.

Listing 15.1. The Bullet Class
 using System; using System.Collections; using Microsoft.DirectX; using Microsoft.DirectX.Direct3D; using Microsoft.Samples.DirectX.UtilityToolkit; namespace Tankers { /// <summary> ...

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