public void KillAll() { BarrierManager.KillAll(); EnemyMatrixManager.KillAll(); ShipsManager.KillAll(); MotherShip.CommitSuicide(); }
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()); }
public void PresetLevel() { BarrierManager.PresetLevel(Level); MotherShip.ResetPosition(); EnemyMatrixManager.PresetLevel(Level); ShipsManager.PresetLevel(); initGameComponentsPositions(); }
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; }
public bool EnemyAtBottom() { bool isEnemyAtBottom = false; if (EnemyMatrixManager.BottomBoundEnemy != null) { isEnemyAtBottom = EnemyMatrixManager.BottomBoundEnemy.Position.Y + m_EnemyOriginalHeight >= ShipsManager.ShipsYPosition(); } return(isEnemyAtBottom); }
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); }