/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { //Create the camera 50 units behind Vector3.Zero where playerShip spawns. camera = new Player.Camera(this, 50.0f * Vector3.Backward, Vector3.Zero, Vector3.Up); Components.Add(camera); modelManager = new Models.ModelManager(this, graphics.GraphicsDevice); Components.Add(modelManager); Model playerShipModel = Content.Load<Model>(@"Models\PlayerShipModel"); playerShip = new Player.PlayerShip(this, playerShipModel); gameState = new GameState(); levelManager = new Levels.LevelManager(); levelManager.SelectLevel(1); modelManager.LoadLevel(levelManager.currentLevel); base.Initialize(); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { //Create the camera 1000 units behind Vector3.Zero where playerShip spawns. camera = new Player.Camera(this, 1000.0f * Vector3.Backward, Vector3.Zero, Vector3.Up); Components.Add(camera); Model playerShipModel = Content.Load<Model>(@"Models\PlayerShipModel"); playerShip = new Player.PlayerShip(this, playerShipModel); modelManager = new Models.ModelManager(this); Components.Add(modelManager); base.Initialize(); }
public override void Draw(Camera camera) { world = Matrix.CreateWorld(position, Vector3.Forward, Vector3.Up); base.Draw(camera); }