diff options
author | Ekaitz Zarraga <ekaitz@elenq.tech> | 2022-05-21 22:24:01 +0200 |
---|---|---|
committer | Ekaitz Zarraga <ekaitz@elenq.tech> | 2022-05-21 22:59:59 +0200 |
commit | d324ad963c24edf6d19dffc305a38e0b3607b5c1 (patch) | |
tree | 10d487be5d723882a12876ea34bf2dcc2233a4d1 /src/keyboard.cpp | |
parent | 27a55a2e841e9c248d6b055780a519a7b5ee4263 (diff) |
Add piece rotation
Diffstat (limited to 'src/keyboard.cpp')
-rw-r--r-- | src/keyboard.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/keyboard.cpp b/src/keyboard.cpp index 8f5d81c..8c94c68 100644 --- a/src/keyboard.cpp +++ b/src/keyboard.cpp @@ -7,6 +7,7 @@ Keyboard::Keyboard(){ releasedDown = new KeyboardDownReleased; pressedLeft = new KeyboardLeftPressed; pressedRight = new KeyboardRightPressed; + pressedSpace = new KeyboardSpacePressed; } Keyboard::~Keyboard(){ delete nop; @@ -14,6 +15,7 @@ Keyboard::~Keyboard(){ delete releasedDown; delete pressedLeft; delete pressedRight; + delete pressedSpace; } Command* Keyboard::handleEvent( SDL_Event e ){ @@ -35,6 +37,8 @@ Command* Keyboard::pressed( SDL_Keycode k, Uint16 mod ){ return pressedLeft; case SDLK_RIGHT: return pressedRight; + case SDLK_SPACE: + return pressedSpace; default: return nop; } |