Exemplo n.º 1
0
 public override void Update(GameTime gameTime)
 {
     base.Update(gameTime);
     if (jumpingBall != null)
     {
         jumpingBall.Update(gameTime);
     }
     moneyText.Text = GameSettingHelper.GetMoney().ToString("N0");
 }
Exemplo n.º 2
0
        private void SetupEndGame()
        {
            endGameOverlay.AdditionMoney = Level;
            endGameOverlay.Score         = Level;
            endGameOverlay.HighScore     = GameSettingHelper.GetHighScore();
            tempMoney = GameSettingHelper.GetMoney();
            endGameOverlay.TotalMoney = tempMoney;
            GameSettingHelper.SetMoney(tempMoney + Level);

            endGameOverlay.Show();
        }
Exemplo n.º 3
0
        public override void HandleInput(InputHelper inputHelper)
        {
            if (getBallOverlay.Visible)
            {
                getBallOverlay.HandleInput(inputHelper);
                return;
            }

            if (confirmOverlay.Visible)
            {
                confirmOverlay.HandleInput(inputHelper);
                return;
            }

            if (tagOverlay.Visible)
            {
                tagOverlay.HandleInput(inputHelper);
                return;
            }

            if (warningOverlay.Visible)
            {
                warningOverlay.HandleInput(inputHelper);
                return;
            }

            base.HandleInput(inputHelper);

            if (getBallButton.Pressed)
            {
                ExtendedGame.AssetManager.PlaySoundEffect("Sounds/snd_click");
                if (GameSettingHelper.GetMoney() >= 100)
                {
                    confirmOverlay.Show();
                }
                else
                {
                    warningOverlay.Show();
                }
            }

            if (replayButton.Pressed)
            {
                ExtendedGame.AssetManager.PlaySoundEffect("Sounds/snd_click");
                ExtendedGame.GameStateManager.SwitchTo(StateName.Home);
            }

            if (tagButton.Pressed)
            {
                ExtendedGame.AssetManager.PlaySoundEffect("Sounds/snd_click");
                tagOverlay.Show();
            }
        }
Exemplo n.º 4
0
        public void GameOver()
        {
            var currentMoney = GameSettingHelper.GetMoney();

            if (canContinue && currentMoney >= 10)
            {
                continueOverlay.Show();
            }
            else
            {
                SetupEndGame();
            }
        }
Exemplo n.º 5
0
        public override void HandleInput(InputHelper inputHelper)
        {
            base.HandleInput(inputHelper);

            if (cancelButton.Pressed)
            {
                ExtendedGame.AssetManager.PlaySoundEffect("Sounds/snd_click");
                Hide();
            }

            if (continueButton.Pressed)
            {
                ExtendedGame.AssetManager.PlaySoundEffect("Sounds/snd_click");
                Hide();
                GameSettingHelper.SetMoney(GameSettingHelper.GetMoney() - 100);
                getBallOverlay.Show();
            }
        }
Exemplo n.º 6
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            scoreText.Text     = Score.ToString("N0");
            highScoreText.Text = HighScore.ToString("N0");
            int realtimeMoney = GameSettingHelper.GetMoney();

            if (TotalMoney != realtimeMoney - AdditionMoney)
            {
                totalMoneyText.Text       = GameSettingHelper.GetMoney().ToString("N0");
                additionMoneyText.Visible = false;
            }
            else
            {
                totalMoneyText.Text    = TotalMoney.ToString("N0");
                additionMoneyText.Text = "+ " + AdditionMoney.ToString("N0");
            }
        }
Exemplo n.º 7
0
        public override void Update(GameTime gameTime)
        {
            if (endGameOverlay.Visible)
            {
                endGameOverlay.Update(gameTime);
                return;
            }

            if (continueOverlay.Visible)
            {
                return;
            }

            if (pauseOverlay.Visible)
            {
                return;
            }

            playScore.Text     = Level.ToString("N0");
            playHighScore.Text = "TOP " + GameSettingHelper.GetHighScore().ToString("N0");
            playMoney.Text     = GameSettingHelper.GetMoney().ToString("N0");
            base.Update(gameTime);
        }
Exemplo n.º 8
0
 public void Continue()
 {
     GameSettingHelper.SetMoney(GameSettingHelper.GetMoney() - 10);
     ClearDeadRows();
     canContinue = false;
 }