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

Someone Has to Control the Tanks

Now that you have an actual world as well as a tank to reside in that world, you need some way to allow your players to interact with the tank (and as a side effect, the world). The player object you're about to take will be the first object you create that implements the IMoveableObject interface you defined in the last chapter. You will be able to detect whether any object that implements the interface is within the view frustum and should be rendered at all. Before you get there, though, you probably want to implement the class itself. Add a new code file player.cs, and see Listing 14.3 for an initial implementation.

Listing 14.3. The Player Class
 using System; using System.Windows.Forms; using Microsoft.DirectX; ...

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