Esempio n. 1
0
        public void GameStartsWithWaveOne()
        {
            InvadersModel model = new InvadersModel();

            model.StartGame();
            Assert.Equal(1, model.Wave);
        }
 public void StartGame()
 {
     Paused = false;
     foreach (var invader in _invaders.Values)
     {
         _sprites.Remove(invader);
     }
     foreach (var shot in _shots.Values)
     {
         _sprites.Remove(shot);
     }
     _model.StartGame();
     OnPropertyChanged("GameOver");
     _timer.Start();
 }
Esempio n. 3
0
 public void StartGame()
 {
     Paused = false;
     foreach (FrameworkElement invader in _invaders.Values)
     {
         _sprites.Remove(invader);
     }
     _invaders.Clear();
     foreach (var shot in _shots.Values)
     {
         _sprites.Remove(shot);
     }
     _shots.Clear();
     foreach (FrameworkElement star in _stars.Values)
     {
         _sprites.Remove(star);
     }
     _stars.Clear();
     _model.StartGame();
     OnPropertyChanged("GameOver"); // TODO: not sure why this is necessary. May cause problems
     _timer.Start();
 }