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