Bug Description
When two or more pests reach the end of the path at the exact same frame, the lives counter decrements multiple times simultaneously, causing it to display negative values like -1 or -2 instead of triggering game over at 0.
Steps to Reproduce
- Start the game on any stage
- Let two pests reach the end at the same time (easier on higher stages with faster pest speed)
- Observe the lives counter in the UI
Expected Behavior
When lives reach 0, the game over screen should trigger immediately. The lives counter should never go below 0.
Actual Behavior
Lives counter shows -1 or -2. Game over condition is not triggered because the check likely compares lives === 0 instead of lives <= 0, so negative values bypass the game over state entirely.
Root Cause (suspected)
In script.js, the lives decrement and game over check likely runs as:
lives--;
if (lives === 0) gameOver();
Instead of:
lives--;
if (lives <= 0) gameOver();
Environment
- Chrome 122 / Firefox 124
- Windows 10 / macOS
Wallet: 0x964739472C587d24934c37BEbB405CeE36D59B24
Bug Description
When two or more pests reach the end of the path at the exact same frame, the lives counter decrements multiple times simultaneously, causing it to display negative values like -1 or -2 instead of triggering game over at 0.
Steps to Reproduce
Expected Behavior
When lives reach 0, the game over screen should trigger immediately. The lives counter should never go below 0.
Actual Behavior
Lives counter shows -1 or -2. Game over condition is not triggered because the check likely compares
lives === 0instead oflives <= 0, so negative values bypass the game over state entirely.Root Cause (suspected)
In script.js, the lives decrement and game over check likely runs as:
Instead of:
Environment
Wallet: 0x964739472C587d24934c37BEbB405CeE36D59B24