Example #1
0
        public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
        {
            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);

            mouse.Update();

            exitButton.Update(mouse.rectangle);
            if (exitButton.Intersects(mouse.rectangle) && mouse.newLeftClick)
            {
                exitButton.sound.Play();
                ScreenManager.RemoveScreen(this);
                ScreenManager.AddScreen(new MainMenuScreen(), null);
            }
            player.UpdateSimple(gameTime);
        }
Example #2
0
        public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
        {
            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
            mouse.Update();

            easyButton.Update(mouse.rectangle);
            if (easyButton.Intersects(mouse.rectangle) && mouse.newLeftClick)
            {
                ExitScreen();
            }

            hardButton.Update(mouse.rectangle);
            if (hardButton.Intersects(mouse.rectangle) && mouse.newLeftClick)
            {
                ExitScreen();
                System.Threading.Thread.Sleep(100);
                ScreenManager.AddScreen(new MainMenuScreen(), null);
            }
        }
Example #3
0
        public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
        {
            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
            mouse.Update();

            exitButton.Update(mouse.rectangle);
            if (exitButton.Intersects(mouse.rectangle) && mouse.newLeftClick)
            {
                exitButton.sound.Play();
                ExitScreen();
                if (player.level < 3)
                {
                    ScreenManager.AddScreen(new GamePlayScreen(GameDifficulty.EASY_MODE, player.name, player.score, player._lives, player._health, player.level + 1), null);
                }
                else
                {
                    ScreenManager.AddScreen(new GameOverScreen(player, GameOverScreen.gameOverType.COMPLETE), null);
                }
            }
        }
        public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
        {
            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
            mouse.Update();

            easyButton.Update(mouse.rectangle);
            if (easyButton.Intersects(mouse.rectangle) && mouse.newLeftClick)
            {
                easyButton.sound.Play();
                ScreenManager.RemoveScreen(this);
                ScreenManager.AddScreen(new NameEntryScreen(GameDifficulty.EASY_MODE), null);
            }

            hardButton.Update(mouse.rectangle);
            if (hardButton.Intersects(mouse.rectangle) && mouse.newLeftClick)
            {
                hardButton.sound.Play();
                ScreenManager.RemoveScreen(this);
                ScreenManager.AddScreen(new NameEntryScreen(GameDifficulty.HARD_MODE), null);
            }
        }
        public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
        {
            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
            mouse.Update();

            highscoresButton.Update(mouse.rectangle);
            if (highscoresButton.Intersects(mouse.rectangle) && mouse.newLeftClick)
            {
                click.Play();
                ExitScreen();
                ScreenManager.AddScreen(new HighScoreScreen(), null);
            }

            newGameButton.Update(mouse.rectangle);
            if (newGameButton.Intersects(mouse.rectangle) && mouse.newLeftClick)
            {
                click.Play();
                ExitScreen();
                ScreenManager.AddScreen(new ModeSelectScreen(), null);
            }

            exitButton.Update(mouse.rectangle);
            if (exitButton.Intersects(mouse.rectangle) && mouse.newLeftClick)
            {
                click.Play();
                ExitScreen();
                ScreenManager.Game.Exit();
            }

            helpButton.Update(mouse.rectangle);
            if (helpButton.Intersects(mouse.rectangle) && mouse.newLeftClick)
            {
                click.Play();
                ExitScreen();
                ScreenManager.AddScreen(new InstructionsScreen(), null);
            }
        }