Beispiel #1
0
 public void KillAll()
 {
     BarrierManager.KillAll();
     EnemyMatrixManager.KillAll();
     ShipsManager.KillAll();
     MotherShip.CommitSuicide();
 }
Beispiel #2
0
 private void initGameComponentsPositions()
 {
     EnemyMatrixManager.InitPositions();
     m_EnemyOriginalHeight = EnemyMatrixManager.EnemyMatrix[0][0].Height;
     m_EnemyOriginalWidth  = EnemyMatrixManager.EnemyMatrix[0][0].Width;
     ShipsManager.InitShipsPositions();
     BarrierManager.InitBarriersPositions(ShipsManager.ShipsYPosition());
 }
Beispiel #3
0
 public void PresetLevel()
 {
     BarrierManager.PresetLevel(Level);
     MotherShip.ResetPosition();
     EnemyMatrixManager.PresetLevel(Level);
     ShipsManager.PresetLevel();
     initGameComponentsPositions();
 }
Beispiel #4
0
 public GameManager(Game i_Game)
     : base(i_Game)
 {
     Level              = 1;
     BarrierManager     = new BarrierManager(i_Game, Level);
     EnemyMatrixManager = new EnemyMatrixManager(i_Game, Level);
     ShipsManager       = new ShipsManager(i_Game);
     MotherShip         = new MotherShip(i_Game);
     CurrentTotalScore  = 0;
     SoundManager       = Game.Services.GetService(typeof(ISoundManager)) as ISoundManager;
     BlendState         = BlendState.NonPremultiplied;
 }
Beispiel #5
0
        public bool EnemyAtBottom()
        {
            bool isEnemyAtBottom = false;

            if (EnemyMatrixManager.BottomBoundEnemy != null)
            {
                isEnemyAtBottom = EnemyMatrixManager.BottomBoundEnemy.Position.Y + m_EnemyOriginalHeight
                                  >= ShipsManager.ShipsYPosition();
            }

            return(isEnemyAtBottom);
        }
Beispiel #6
0
        public bool CheckIfGameIsOver()
        {
            bool isGameOver = false;

            if (EnemyAtBottom() || !ShipsManager.IsThereAShipAlive())
            {
                SoundManager.PlaySound(GameSettings.s_SoundEffectsNames[GameSettings.eSoundEffects.GameOver]);
                isGameOver = true;
                WinnerName = ShipsManager.WhoWon();
            }

            return(isGameOver);
        }