public Game1()
        {
            graphics     = new GraphicsDeviceManager(this);
            Window.Title = "Asteroids 3D in XNA 4 Chapter Five";
            graphics.PreferredBackBufferWidth  = 1024;
            graphics.PreferredBackBufferHeight = 600;
            graphics.ApplyChanges();

            Content.RootDirectory = "Content";

            Camera     = new Engine.Camera(this, new Vector3(0, 0, 275), Vector3.Forward, Vector3.Zero, false, 200, 325);
            Background = new Entities.Background(this);
            screenHUD  = new Entities.HUD(this);
            Player     = new Entities.Player(this);
            UFOs       = new Entities.UFOController(this);
            Rocks      = new Entities.RockController(this);
        }
Exemple #2
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Window.Title = "Asteroids 3D in XNA 4 Chapter Five";
            graphics.PreferredBackBufferWidth = 1024;
            graphics.PreferredBackBufferHeight = 600;
            graphics.ApplyChanges();

            Content.RootDirectory = "Content";

            Camera = new Engine.Camera(this, new Vector3(0, 0, 275), Vector3.Forward, Vector3.Zero, false, 200, 325);
            Background = new Entities.Background(this);
            screenHUD = new Entities.HUD(this);
            Player = new Entities.Player(this);
            UFOs = new Entities.UFOController(this);
            Rocks = new Entities.RockController(this);
        }
        /// <summary>
        /// This is used to start up Panther Engine Services.
        /// It makes sure that it has not already been started if it has been it will throw and exception
        /// to let the user know.
        /// 
        /// You pass in the game class so you can get information needed.
        /// </summary>
        /// <param name="game">Reference to the game class.</param>
        /// <param name="graphicsDevice">Reference to the graphic device.</param>
        /// <param name="Camera">For passing the reference of the camera when instanced.</param>
        public static void Initialize(Game game, GraphicsDevice graphicsDevice, Camera camera)
        {
            //First make sure there is not already an instance started
            if (instance == null)
            {
                //Create the Engine Services
                instance = new Services(game);
                //Reference the camera to the property.
                Camera = camera;
                graphics = graphicsDevice;
                randomNumber = new Random();
                return;
            }

            throw new Exception("The Engine Services have already been started.");
        }