Esempio 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);
            }
        }
Esempio 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());
 }
Esempio n. 3
0
 public override void HandleInput(InputHandler input)
 {
     if (input.Keyboard.WasKeyPressed(Keys.Enter))
         this.ExitScreen();
 }
Esempio n. 4
0
 public ScreenManager(Game game)
     : base(game)
 {
     input = new InputHandler(game);
     game.Components.Add(input);
 }
Esempio n. 5
0
 public virtual void HandleInput(InputHandler input)
 {
 }