mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:47:46 +00:00
Breakout: Add possibility to play with A and D
This change will make the player able to control the game with A and D keys, in addition to the current arrow keys and mouse.
This commit is contained in:
parent
28fabd4728
commit
ef3f9b24dd
1 changed files with 4 additions and 0 deletions
|
@ -152,9 +152,11 @@ void Game::keyup_event(GUI::KeyEvent& event)
|
|||
if (m_paused)
|
||||
return;
|
||||
switch (event.key()) {
|
||||
case Key_A:
|
||||
case Key_Left:
|
||||
m_paddle.moving_left = false;
|
||||
break;
|
||||
case Key_D:
|
||||
case Key_Right:
|
||||
m_paddle.moving_right = false;
|
||||
break;
|
||||
|
@ -171,9 +173,11 @@ void Game::keydown_event(GUI::KeyEvent& event)
|
|||
case Key_Escape:
|
||||
GUI::Application::the()->quit();
|
||||
break;
|
||||
case Key_A:
|
||||
case Key_Left:
|
||||
m_paddle.moving_left = true;
|
||||
break;
|
||||
case Key_D:
|
||||
case Key_Right:
|
||||
m_paddle.moving_right = true;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue