Ejemplo 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);
        }
Ejemplo 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();
 }
Ejemplo 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
			}
		}
Ejemplo 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();
 }
Ejemplo n.º 5
0
 public void RestartGame()
 {
     InteractionLogic.Restart();
     score = 0;
     HudInterface.SetScoreText(score);
     HudInterface.SetInGameMode();
     GameState = GameState.Playing;
     controls.SetControlsToState(GameState);
 }