Ejemplo n.º 1
0
        public override void HandleInput(InputHandler input)
        {
            if (input.Keyboard.WasKeyPressed(Keys.Enter))
                ScreenManager.AddScreen(new PauseScreen());

            // movement from keyboard input (paddle)
            if (input.Keyboard.IsKeyDown(Keys.Left))
            {
                paddle.MoveLeft();
            }
            else if (input.Keyboard.IsKeyDown(Keys.Right))
            {
                paddle.MoveRight();
            }
            else
            {
                paddle.DoNotMove();
            }

            // ball launch
            if (input.Keyboard.IsKeyDown(Keys.Space))
            {
                ball.Launch(paddle.BoundingRectangle);
            }
        }
Ejemplo n.º 2
0
 public override void HandleInput(InputHandler input)
 {
     if (input.Keyboard.WasKeyPressed(Keys.Down))
         this.ExitScreen();
     if (input.Keyboard.WasKeyPressed(Keys.Enter))
         ScreenManager.AddScreen(new GameScreen());
 }
Ejemplo n.º 3
0
 public override void HandleInput(InputHandler input)
 {
     if (input.Keyboard.WasKeyPressed(Keys.Enter))
         this.ExitScreen();
 }
Ejemplo n.º 4
0
 public ScreenManager(Game game)
     : base(game)
 {
     input = new InputHandler(game);
     game.Components.Add(input);
 }
Ejemplo n.º 5
0
 public virtual void HandleInput(InputHandler input)
 {
 }