Skip to content

Conversation

@wcode0
Copy link

@wcode0 wcode0 commented Dec 6, 2025

Your checklist for this pull request

Author name

Author:

About your game

What is your game about?

How do you play your game?

Code

Check off the items that are true.

  • The game was made using the Sprig editor.
  • The game is placed in the in the /games directory.
  • The code is significantly different from all other games in the Sprig gallery (except for games labeled "demo").
  • The game runs without errors.
  • The name of the file/game contains only alphanumeric characters, -s, or _s.
  • The game name is not the same as the others from gallery
  • The game has metadata at the top of the file in the following format:
    /*
    @title:
    @author:
    @description:
    @tags: ['tag1', 'tag2']
    @addedOn: 2025-MM-DD
    */
    

Image (If an image is used)

Thanks for your PR!

Comment on lines +96 to +99
let gameOver = false

function loop() {
if (gameOver) return
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Player can move character after game ends because onInput handlers lack gameOver check.
Severity: MEDIUM | Confidence: High

🔍 Detailed Analysis

The onInput handlers for player movement (onInput("d", ...) and onInput("a", ...)) in stalagmite drop.js do not check the gameOver flag. This allows the player character to move left and right even after the game has ended (either by collision or winning), which is inconsistent with the game's state and other similar games in the codebase. The gameOver variable is declared but never set to true when the game ends, preventing proper state management.

💡 Suggested Fix

Set gameOver = true in win/lose conditions. Guard onInput handlers for movement with if (!gameOver) checks to prevent player input after the game ends.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: games/stalagmite drop.js#L96-L99

Potential issue: The `onInput` handlers for player movement (`onInput("d", ...)` and
`onInput("a", ...)`) in `stalagmite drop.js` do not check the `gameOver` flag. This
allows the player character to move left and right even after the game has ended (either
by collision or winning), which is inconsistent with the game's state and other similar
games in the codebase. The `gameOver` variable is declared but never set to `true` when
the game ends, preventing proper state management.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 5923651

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant