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