예제 #1
0
        /// <summary>
        /// Initialize the game, after the ScreenManager is set, but not every time
        /// the graphics are reloaded.
        /// </summary>
        public void Initialize()
        {
            Defines.playersGestures.Clear();
            Defines.playerFusionTriggered.Clear();

            Defines.clientBounds = ScreenManager.Game.Window.ClientBounds;
            //Set up the frames counter
            ScreenManager.Game.Components.Add(new FPSComponent(ScreenManager.Game));

            //Set up the bloom post-process effect
            bloomComponent = new BloomComponent(ScreenManager.Game);
            //bloomComponent.Visible = false;
            ScreenManager.Game.Components.Add(bloomComponent);

            // Initialize an instance of the high score screen
            hss = new HighScoreScreen(ScreenManager.Game);

            //Set up the console writer.
            //consoleComponent = new ConsoleComponent(clientBounds);

            //Set up the sprite managers
            //playerSpriteManager = new SpriteManagerComponent(this);
            enemySpriteManager = new SpriteManager(ScreenManager.Game);

            //Set up the players
            //TODO: Only signed in players should be added.
            playerManager = new PlayerManager(ScreenManager.Game);

            // Check whether if two controllers are currently active (Comment to default to two-player mode)
            // TODO: Add additional check for if the game is currently running or not
            //if (!GamePad.GetState(PlayerIndex.Two).IsConnected)
            //    twoPlayerMode = false;

            // Set up powerup manager
            powerupManager = new PowerupManager(ScreenManager.Game);

            // Set up the charge Bar
            chargeBar = new ChargeBar(ScreenManager.Game);

            // Set up repair powerup
            // repairPowerup = new RepairPowerup(ScreenManager.Game);

            //Set up the particle system manager.
            Defines.particleManager = new ParticleManager(ScreenManager.Game);

            gameOver = false;
        }
        /// <summary>
        /// Initialize the game, after the ScreenManager is set, but not every time
        /// the graphics are reloaded.
        /// </summary>
        public void Initialize()
        {
            Defines.playersGestures.Clear();
            Defines.playerFusionTriggered.Clear();

            Defines.clientBounds = ScreenManager.Game.Window.ClientBounds;
            //Set up the frames counter
            ScreenManager.Game.Components.Add(new FPSComponent(ScreenManager.Game));

            //Set up the bloom post-process effect
            bloomComponent = new BloomComponent(ScreenManager.Game);
            //bloomComponent.Visible = false;
            ScreenManager.Game.Components.Add(bloomComponent);

            // Initialize an instance of the high score screen
            hss = new HighScoreScreen(ScreenManager.Game);

            //Set up the console writer.
            //consoleComponent = new ConsoleComponent(clientBounds);

            //Set up the sprite managers
            //playerSpriteManager = new SpriteManagerComponent(this);
            enemySpriteManager = new SpriteManager(ScreenManager.Game);

            //Set up the players
            //TODO: Only signed in players should be added.
            playerManager = new PlayerManager(ScreenManager.Game);

            // Check whether if two controllers are currently active (Comment to default to two-player mode)
            // TODO: Add additional check for if the game is currently running or not
            //if (!GamePad.GetState(PlayerIndex.Two).IsConnected)
            //    twoPlayerMode = false;

            // Set up powerup manager
            powerupManager = new PowerupManager(ScreenManager.Game);

            // Set up the charge Bar
            chargeBar = new ChargeBar(ScreenManager.Game);

            // Set up repair powerup
               // repairPowerup = new RepairPowerup(ScreenManager.Game);

            //Set up the particle system manager.
            Defines.particleManager = new ParticleManager(ScreenManager.Game);

            gameOver = false;
        }