Exemple #1
0
 private void InitializeMemberVariables()
 {
     myGameState    = GameState.Menu;
     mySoundManager = new SongManager();
     myMenuManager  = new MenuManager(myFont);
     SoundEffectManager.InitalizeVariables();
     Camera.Reset();
 }
 private void ShootProjectile(object aSender, EventArgs aEventArg)
 {
     if (aSender is Player)
     {
         myProjectiles.Add(new PlayerProjectile(aSender as Player));
     }
     else if (aSender is Turret)
     {
         myProjectiles.Add(new TurretProjectile(aSender as Turret));
     }
     else if (aSender is ShootingEnemy)
     {
         myProjectiles.Add(new EnemyProjectile(aSender as ShootingEnemy));
     }
     SoundEffectManager.PlayShootSound();
 }
Exemple #3
0
        protected override void Update(GameTime aGameTime)
        {
            UpdateUtilities();
            switch (myGameState)
            {
            case GameState.Playing:
                myGameBoard.Update(aGameTime);
                Camera.Update();
                SoundEffectManager.Update(aGameTime);
                break;

            case GameState.Menu:
                Camera.Reset();
                myMenuManager.Update();
                break;
            }

            UpdateSoundManager();
            myOldGameState = myGameState;

            base.Update(aGameTime);
        }