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

Plugging into the Game Engine

Before you start writing any code to hook things together, you need to make sure that you have the required variables and constants declared. Add the declarations from Listing 17.1 to your game engine class.

Listing 17.1. Declarations
 // Constants for starting locations and rotations within the levels private static readonly Vector3 Player1StartLocation = new Vector3(-2600,0,-2600); private static readonly Vector3 Player2StartLocation = new Vector3(2600,0,2600); private const float Player1StartRotation = (float)Math.PI / 4.0f; private const float Player2StartRotation = (float)Math.PI + (float)Math.PI / 4.0f; // Store the sky box private Skybox worldSky = null; // Store the level private Level worldLevel = null; ...

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