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; ...

Get Beginning 3D Game Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.