1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:47:35 +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:
Matheus Vinicius 2021-09-15 02:17:53 -03:00 committed by Brian Gianforcaro
parent 28fabd4728
commit ef3f9b24dd

View file

@ -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;