From d324ad963c24edf6d19dffc305a38e0b3607b5c1 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Sat, 21 May 2022 22:24:01 +0200 Subject: Add piece rotation --- src/keyboard.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/keyboard.cpp') 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; } -- cgit v1.2.3