Hide play/pause once someone has run out
At a flag the game is over and togglePause is inert anyway — pauseNow needs RUN, resumeNow needs PAUSE — so the button was there without being able to do anything. It joins the other two visibility rules in render(): vacant at IDLE or FLAG. Reset stays, being the way out of a finished game, and the bar comes down to Reset, score and sound. Checked the whole state machine: shown while running and while paused, vacant before a game's first tap and at a flag, and pausing and resuming still work. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -811,7 +811,9 @@
|
||||
var pristine = matchPristine();
|
||||
btnSettings.classList.toggle("btn--vacant", !pristine);
|
||||
btnReset.classList.toggle("btn--vacant", pristine); // nothing played to reset
|
||||
btnPlay.classList.toggle("btn--vacant", st.phase === IDLE); // nothing running to pause
|
||||
// nothing running to pause: before a game's first tap, and after a flag,
|
||||
// where togglePause is inert anyway — the game is over, Reset is the way out
|
||||
btnPlay.classList.toggle("btn--vacant", st.phase === IDLE || st.phase === FLAG);
|
||||
}
|
||||
|
||||
function loop(){ render(); requestAnimationFrame(loop); }
|
||||
|
||||
Reference in New Issue
Block a user