Exemplo n.º 1
0
        public AsteroidGame(Game game, GraphicsDeviceManager g, SpriteBatch sb)
            : base(game, g, new Rectangle(0, 0, 600, 600), sb)
        {
            _gs = new GameState(this);
            CurrentState = _gs;

            _pausestate = new PauseState(this);
        }
Exemplo n.º 2
0
 public void GameOver()
 {
     if (GameState == GameState.GameOver)
         return;
     RefreshHighScores();
     InteractionLogic.PauseUpdate();
     InteractionLogic.Player.Dispose();
     GameState = GameState.GameOver;
     controls.SetControlsToState(GameState);
     HudInterface.SetGameOverText();
 }
Exemplo n.º 3
0
		public void SetControlsToState(GameState state)
		{
			for (int i = 0; i < commandsInUse; i++)
				controlCommands[i].Dispose();
			commandsInUse = 0;
			switch (state)
			{
			case GameState.Playing:
				AddPlayerAccelerationControl();
				AddPlayerSteerLeft();
				AddPlayerSteerRight();
				AddPlayerShootingControls();
				AddPlayerMoveDirectly();
				break;
			case GameState.GameOver:
				AddRestartControl();
				AddMainMenuControl();
				break;
			default:
				return; //ncrunch: no coverage
			}
		}
Exemplo n.º 4
0
 public void StartGame()
 {
     mainMenu.Hide();
     Show();
     controls = new Controls(this);
     score = 0;
     GameState = GameState.Playing;
     InteractionLogic.BeginGame();
     SetUpEvents();
     controls.SetControlsToState(GameState);
     HudInterface = new HudInterface();
 }
Exemplo n.º 5
0
 public void RestartGame()
 {
     InteractionLogic.Restart();
     score = 0;
     HudInterface.SetScoreText(score);
     HudInterface.SetInGameMode();
     GameState = GameState.Playing;
     controls.SetControlsToState(GameState);
 }