Hold block added
This commit is contained in:
@ -1134,7 +1134,7 @@ void MenuState::render(SDL_Renderer* renderer, float logicalScale, SDL_Rect logi
|
||||
// Shortcut entries (copied from HelpOverlay)
|
||||
struct ShortcutEntry { const char* combo; const char* description; };
|
||||
const ShortcutEntry generalShortcuts[] = {
|
||||
{"H", "Toggle this help overlay"},
|
||||
{"F1", "Toggle this help overlay"},
|
||||
{"ESC", "Back / cancel current popup"},
|
||||
{"F11 or ALT+ENTER", "Toggle fullscreen"},
|
||||
{"M", "Mute or unmute music"},
|
||||
@ -1149,6 +1149,7 @@ void MenuState::render(SDL_Renderer* renderer, float logicalScale, SDL_Rect logi
|
||||
{"DOWN", "Soft drop (faster fall)"},
|
||||
{"SPACE", "Hard drop / instant lock"},
|
||||
{"UP", "Rotate clockwise"},
|
||||
{"H", "Hold / swap current piece"},
|
||||
{"X", "Toggle rotation direction used by UP"},
|
||||
{"P", "Pause or resume"},
|
||||
{"ESC", "Open exit confirmation"}
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user