Ejemplo n.º 1
0
        protected void done()
        {
            GameScreen previousScreen = ScreensManager.ActiveScreen.PreviousScreen;

            ScreensManager.Remove(ScreensManager.ActiveScreen);
            ScreensManager.SetCurrentScreen(previousScreen);
        }
Ejemplo n.º 2
0
        private void onGameOver(object sender, EventArgs e)
        {
            string scoreText = sender as string;

            ScreensManager.SetCurrentScreen(new GameOverScreen(m_Game, scoreText));
            Dispose();
            ScreensManager.Remove(this);
        }
Ejemplo n.º 3
0
        private void onLevelWon(object sender, EventArgs e)
        {
            LevelTransitionScreen levelTransScreen = new LevelTransitionScreen(m_Game);

            ScreensManager.SetCurrentScreen(levelTransScreen);
            Dispose();
            ScreensManager.Remove(this);
        }
Ejemplo n.º 4
0
 public override void Update(GameTime gameTime)
 {
     base.Update(gameTime);
     if (InputManager.KeyPressed(Keys.Escape))
     {
         ScreensManager.Remove(this);
     }
     else if (InputManager.KeyPressed(Keys.Enter))
     {
         ScreensManager.SetCurrentScreen(new GamingScreen(this.Game));
         ScreensManager.SetCurrentScreen(new MoveStageScreen(this.Game, 1));
     }
     else if (InputManager.KeyPressed(Keys.F6))
     {
         ScreensManager.SetCurrentScreen(new MainMenuScreen(this.Game));
     }
 }
Ejemplo n.º 5
0
        public override void Update(GameTime i_GameTime)
        {
            base.Update(i_GameTime);
            float totalSec = (float)i_GameTime.ElapsedGameTime.TotalSeconds;

            m_PartialTime += totalSec;

            if (m_PartialTime >= 1)
            {
                m_TimeLeft--;
                m_PartialTime = 0;
            }

            m_LevelCounterText = m_TimeLeft.ToString();

            if (m_TimeLeft < 1)
            {
                m_TimeLeft = 3;
                m_PlayersManager.CurrentLevel++;
                ScreensManager.SetCurrentScreen(new PlayScreen(m_Game));
                Dispose();
                ScreensManager.Remove(this);
            }
        }
Ejemplo n.º 6
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            TouchCollection touchCol = TouchPanel.GetState();

            foreach (var touch in touchCol)
            {
                if (InputManager.KeyPressed(Keys.Enter) || touch.State == TouchLocationState.Pressed)
                {
                    ScreensManager.SetCurrentScreen(new LevelTransitionScreen(m_Game));
                    ScreensManager.Remove(this);
                }
            }
            //else if (InputManager.KeyPressed(Keys.H))
            //{
            //    ScreensManager.SetCurrentScreen(new MainMenuScreen(m_Game));
            //    ScreensManager.Remove(this);
            //}
            if (InputManager.KeyPressed(Keys.Escape) || GamePad.GetState(PlayerIndex.One).Buttons.Back ==
                ButtonState.Pressed)
            {
                this.Game.Exit();
            }
        }