added pause option coop gameplay

This commit is contained in:
2025-12-21 17:59:21 +01:00
parent 06aa63f548
commit 744268fedd
3 changed files with 40 additions and 7 deletions

View File

@ -133,6 +133,16 @@ void PlayingState::handleEvent(const SDL_Event& e) {
return;
}
// Pause toggle (P) - matches classic behavior; disabled during countdown
if (e.key.scancode == SDL_SCANCODE_P) {
const bool countdown = (ctx.gameplayCountdownActive && *ctx.gameplayCountdownActive) ||
(ctx.menuPlayCountdownArmed && *ctx.menuPlayCountdownArmed);
if (!countdown) {
ctx.game->setPaused(!ctx.game->isPaused());
}
return;
}
// Tetris controls (only when not paused)
if (ctx.game->isPaused()) {
return;