示例#1
0
        public void Update(GameTime gameTime)
        {
            fadeInOutTimer.Update(gameTime.TotalGameTime);
            changeLineTimer.Update(gameTime.TotalGameTime);

            if (Keyboard.GetState().IsKeyDown(Keys.Space))
            {
                screenController.GoToProgress();
            }
        }
示例#2
0
        public void Update(GameTime gameTime)
        {
            if (gameState.CurrentLevel < 9)
            {
                if (Keyboard.GetState().IsKeyDown(Keys.Space) || currentDetectivePosition.X > 800)
                {
                    screenController.GoToLevel(gameState.CurrentLevel + 1);
                }

                currentDetectivePosition.X += 2;
            }
            else
            {
                currentDetectivePosition = new Vector2(400, 550);
                if (timer == null)
                {
                    timer = new AnimationTimer(4000, () => currentState++);
                }
                else
                {
                    timer.Update(gameTime.TotalGameTime);
                }
            }

            if (currentState == 1)
            {
                if (gameState.CurrentLevel < 10)
                {
                    gameState.CurrentLevel++;
                }
            }

            if (currentState > 3 && currentState < 5)
            {
                var sh = new Process();
                sh.StartInfo.UseShellExecute = true;
                sh.StartInfo.FileName        = "https://www.youtube.com/watch?time_continue=2&v=dQw4w9WgXcQ";
                sh.Start();
                timer        = null;
                currentState = 10;
            }
        }