added pause option coop gameplay
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user