Hold block added

This commit is contained in:
2025-12-17 21:05:32 +01:00
parent 492abc09bc
commit 0ab7121c5b
6 changed files with 48 additions and 10 deletions

View File

@ -118,6 +118,12 @@ void PlayingState::handleEvent(const SDL_Event& e) {
// Tetris controls (only when not paused)
if (!ctx.game->isPaused()) {
// Hold / swap current piece (H)
if (e.key.scancode == SDL_SCANCODE_H) {
ctx.game->holdCurrent();
return;
}
// Rotation (still event-based for precise timing)
if (e.key.scancode == SDL_SCANCODE_UP) {
// Use user setting to determine whether UP rotates clockwise