Beispiel #1
0
        public void UpdateCamera(GameTime gameTime, PlayerShip currentShip)
        {
            view = Matrix.CreateLookAt(position, target, Vector3.Up);
            position += Misc.Settings.GAME_SPEED * Vector3.Forward * Misc.Settings.SHIP_SPEED;
            target += Misc.Settings.GAME_SPEED * Vector3.Forward * Misc.Settings.SHIP_SPEED;

            base.Update(gameTime);
        }
Beispiel #2
0
        public void UpdateCamera(GameTime gameTime, PlayerShip currentShip)
        {
            view = Matrix.CreateLookAt(position, target, Vector3.Up);
            position += Vector3.Forward;
            target += Vector3.Forward;

            base.Update(gameTime);
        }
Beispiel #3
0
        /// <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();
        }
Beispiel #4
0
        /// <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();
        }