📝 Description
There is a logic breakdown in the game loop state management within the "Simon Says" utility. When a user successfully selects the correct action button matching a valid "Simon says [Action]" command, the application correctly increments the user's score. However, the game fails to dispatch the logic to clear the current timer interval, generate the next command, and reset the UI for the subsequent round. Consequently, the user is left stuck on the current command while the progress bar/timer continues to deplete until it forces a "Game Over" or timeout state.
🔄 Steps to Reproduce
- Open the "Simon Says" utility.
- Click "Start Game".
- Wait for a valid command (e.g., "Simon says Jump").
- Click the corresponding action button (e.g., "Jump") before the progress bar depletes.
- Observe the Score pill increment.
- See error: The command does not update to a new prompt, and the progress bar continues to drain as if the user has not yet interacted with the active turn.
🎯 Expected Behavior
Upon a successful and valid interaction, the component should immediately clear the active setTimeout or setInterval controlling the progress bar. It should then advance the game state by generating a new command (either with or without the "Simon says" prefix) and reset the progress bar UI to full for the new round.
❌ Actual Behavior / Error Logs
The application state registers the point but fails to invoke the nextRound() logic, leaving the active timer running on a completed turn.
💻 Environment
- OS: Windows 11
- Browser: Chrome / Brave
- File Name: Simon Says Component / Game Loop Logic
📝 Description
There is a logic breakdown in the game loop state management within the "Simon Says" utility. When a user successfully selects the correct action button matching a valid "Simon says [Action]" command, the application correctly increments the user's score. However, the game fails to dispatch the logic to clear the current timer interval, generate the next command, and reset the UI for the subsequent round. Consequently, the user is left stuck on the current command while the progress bar/timer continues to deplete until it forces a "Game Over" or timeout state.
🔄 Steps to Reproduce
🎯 Expected Behavior
Upon a successful and valid interaction, the component should immediately clear the active
setTimeoutorsetIntervalcontrolling the progress bar. It should then advance the game state by generating a new command (either with or without the "Simon says" prefix) and reset the progress bar UI to full for the new round.❌ Actual Behavior / Error Logs
The application state registers the point but fails to invoke the
nextRound()logic, leaving the active timer running on a completed turn.💻 Environment