Ejemplo n.º 1
0
 public override void Update()
 {
     base.Update();
     if (Input.KeyDown(Key.Escape))
     {
         Game.Close();
     }
     if (_controller.State == GameState.Menu)
     {
         if (!titleEntity.Transitioning)
         {
             titleEntity.Transitioning   = true;
             messageEntity.Transitioning = true;
             exitEntity.Transitioning    = true;
         }
         else if (titleEntity.Transitioned)
         {
             Game.SwitchScene(new MenuScene(_controller));
         }
     }
     else if (DetectingLaunchpad && _controller.State != GameState.AwaitingLaunchpad)
     {
         DetectingLaunchpad = false;
         Remove(messageEntity);
         messageEntity = new TitleMessageEntity("Press green to start!", titleEntity.X, titleEntity.Y + 150);
         Add(messageEntity);
     }
 }
Ejemplo n.º 2
0
 public override void Update()
 {
     base.Update();
     scoreEntity.UpdateCombo(_controller.Combo, _controller.Score);
     countsEntity.UpdateCounts(_controller);
     if (changingScene)
     {
         if (scoreEntity.Transitioned)
         {
             if (_controller.State == GameState.HighScoreEntryHold)
             {
                 _controller.RemoveHold();
                 Game.SwitchScene(new HighScoreScene(_controller));
             }
             else if (_controller.State == GameState.ReturnToMenuHold)
             {
                 _controller.RemoveHold();
                 _controller.MainLoop(); //we need to do this so that we're all set up to transition to the menu scene.
                 Game.SwitchScene(new MenuScene(_controller));
             }
         }
     }
     else if (_controller.State == GameState.GameEnding || _controller.State == GameState.GameOver)
     {
         if (lastState == GameState.Game)
         {
             //first time in game ending state, set up the various entities for the end of the song.
             if (_controller.Combo == _controller.TotalBeats)
             {
                 fullComboEntity = new FullComboEntity(Game.Instance.HalfWidth, Game.Instance.HalfHeight - 150);
                 Add(fullComboEntity);
             }
             titleMsgEntity = new TitleMessageEntity("Press any pad to continue", Game.Instance.HalfWidth, Game.Instance.HalfHeight + 150);
             Add(titleMsgEntity);
         }
     }
     else if (_controller.State == GameState.HighScoreEntryHold || _controller.State == GameState.ReturnToMenuHold)
     {
         changingScene             = true;
         scoreEntity.Transitioning = true;
         if (fullComboEntity != null)
         {
             fullComboEntity.Transitioning = true;
         }
         titleMsgEntity.Transitioning = true;
     }
     lastState = _controller.State;
 }
Ejemplo n.º 3
0
        //float alpha;

        private void SetupTitleScreen()
        {
            AddGraphic <Image>(new Image(@"..\..\Backgrounds\bg.png"));
            titleEntity = new TitleEntity(Game.Instance.Width / 2, Game.Instance.Height / 2);
            exitEntity  = new ExitEntity(10, 10);
            if (_controller.interf.Connected)
            {
                messageEntity = new TitleMessageEntity("Press green to start!", titleEntity.X, titleEntity.Y + 150);
            }
            else
            {
                messageEntity      = new TitleMessageEntity("No Launchpad detected. Please restart the game with a Launchpad plugged in.", titleEntity.X, titleEntity.Y + 150);
                DetectingLaunchpad = true;
            }
            Add(messageEntity);
            Add(titleEntity);
            Add(exitEntity);
        }