Exemplo n.º 1
0
 public Intro(GameGraphics graphics, ScreenSpace screenSpace, ScreenController screenController)
 {
     this.graphics         = graphics;
     this.screenController = screenController;
     display         = new IntroText(graphics, screenSpace, introText);
     fadeInOutTimer  = new AnimationTimer(150, () => display.Animate());
     changeLineTimer = new AnimationTimer(3000, () => display.Transition());
     Thread.Sleep(200);
 }
Exemplo n.º 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;
            }
        }