added hard drop
This commit is contained in:
@ -148,7 +148,8 @@ void PlayingState::handleEvent(const SDL_Event& e) {
|
|||||||
ctx.coopGame->rotate(CoopGame::PlayerSide::Left, -1);
|
ctx.coopGame->rotate(CoopGame::PlayerSide::Left, -1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (e.key.scancode == SDL_SCANCODE_LSHIFT) {
|
// Hard drop (left): keep LSHIFT, also allow E for convenience.
|
||||||
|
if (e.key.scancode == SDL_SCANCODE_LSHIFT || e.key.scancode == SDL_SCANCODE_E) {
|
||||||
SoundEffectManager::instance().playSound("hard_drop", 0.7f);
|
SoundEffectManager::instance().playSound("hard_drop", 0.7f);
|
||||||
ctx.coopGame->hardDrop(CoopGame::PlayerSide::Left);
|
ctx.coopGame->hardDrop(CoopGame::PlayerSide::Left);
|
||||||
return;
|
return;
|
||||||
@ -168,7 +169,8 @@ void PlayingState::handleEvent(const SDL_Event& e) {
|
|||||||
ctx.coopGame->rotate(CoopGame::PlayerSide::Right, -1);
|
ctx.coopGame->rotate(CoopGame::PlayerSide::Right, -1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (e.key.scancode == SDL_SCANCODE_RSHIFT) {
|
// Hard drop (right): SPACE is the primary key for arrow controls; keep RSHIFT as an alternate.
|
||||||
|
if (e.key.scancode == SDL_SCANCODE_SPACE || e.key.scancode == SDL_SCANCODE_RSHIFT) {
|
||||||
SoundEffectManager::instance().playSound("hard_drop", 0.7f);
|
SoundEffectManager::instance().playSound("hard_drop", 0.7f);
|
||||||
ctx.coopGame->hardDrop(CoopGame::PlayerSide::Right);
|
ctx.coopGame->hardDrop(CoopGame::PlayerSide::Right);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user