예제 #1
0
        /// <summary>
        /// Selected label were chosed.
        /// </summary>
        /// <param name="i_GameTime"></param>
        private void selectionChosed(GameTime i_GameTime)
        {
            if (ScreenMode.HasFlag(eScreenMode.Running))
            {
                switch (m_menuCollection.Selected)
                {
                case 0:
                    DisplaySettingsScreen displaySettings = new DisplaySettingsScreen(ScreensManager);
                    ScreensManager.MoveTo(displaySettings);
                    break;

                case 2:
                    SoundSettingsScreen soundSettings = new SoundSettingsScreen(ScreensManager);
                    ScreensManager.MoveTo(soundSettings);
                    break;

                case 3:
                    GameScreen startGame = StageScreen.GetStages(ScreensManager);
                    ScreensManager.MoveTo(startGame);
                    break;

                case 4:
                    Close();
                    break;
                }

                if (m_menuCollection.Selected != 1)
                {
                    playSound();
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Starting the game from the given stage screen.
        /// </summary>
        /// <param name="i_GameTime">Game Time.</param>
        private void startGame(GameTime i_GameTime)
        {
            ScreensManager.RootScreen = new MainMenuScreen(ScreensManager);
            KeyboardManager keyboardManager = ScreensManager.KeyboardManager;
            GameScreen      startTimer      = StageScreen.GetStages(ScreensManager);

            ScreensManager.MoveTo(startTimer);
        }
예제 #3
0
        /// <summary>
        /// Stages sequence creator.
        /// </summary>
        /// <param name="i_ScreensManager">Screen manager.</param>
        /// <param name="i_PlayersAmount">Players amount.</param>
        /// <returns></returns>
        public static GameScreen GetStages(ScreensManager i_ScreensManager)
        {
            StageScreen stage       = new StageScreen(i_ScreensManager, (int)i_ScreensManager.GameSettings.PlayersAmount);
            string      stageString = "Stage: 1";
            TimerScreen timerScreen = new TimerScreen(stage, 3, stageString);

            return(timerScreen);
        }
예제 #4
0
        /// <summary>
        /// Going to next stage screen.
        /// </summary>
        private void nextStage()
        {
            clearStageComponents();
            SoundManager soundManager = Game.Services.GetService(typeof(SoundManager)) as SoundManager;

            soundManager.PlaySoundEffect(eSounds.LevelWin);
            StageScreen nextStage   = new StageScreen(ScreensManager, m_level + 1, m_spaceships);
            string      stageString = string.Format("Stage: {0}", m_level + 1);
            TimerScreen timerScreen = new TimerScreen(nextStage, 3, stageString);

            Enemy.LevelUp();
            bool v_EraseLastStage = true;

            ScreensManager.MoveTo(timerScreen, v_EraseLastStage);
        }
예제 #5
0
 /// <summary>
 /// Acting for keyboard state.
 /// </summary>
 /// <param name="i_KeyboardState">Keyboard state.</param>
 protected override void actForKeyboardState(KeyboardState i_KeyboardState)
 {
     if (i_KeyboardState.IsKeyDown(Keys.Escape))
     {
         ScreensManager.Quit();
     }
     else if (i_KeyboardState.IsKeyDown(Keys.Home))
     {
         bool       v_EraseThisScreen = true;
         GameScreen startTimer        = StageScreen.GetStages(ScreensManager);
         ScreensManager.MoveTo(startTimer, v_EraseThisScreen);
     }
     else if (i_KeyboardState.IsKeyDown(Keys.N))
     {
         ScreensManager.MoveBackToRootScreen();
     }
 }