Skip to content

Conversation

@5ghzx
Copy link

@5ghzx 5ghzx commented Nov 16, 2025

Your checklist for this pull request

Author name

**Author:**Hadi Abbasi/5ghzx

About your game

What is your game about? My game is a puzzle game where you must push rocks out of the way to reach the exit. But beware. If you push the rocks the wrong way, you will block your path and trap yourself.

How do you play your game? Use WASD keys to move. Move into rocks to push them. Press J to restart the level.

Code

Check off the items that are true.

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

Image (If an image is used)

Thanks for your PR!
fixed version of #3388


afterInput(() => {
if (tilesWith(player, goal).length > 0) {
setMap(levels[1])
Copy link

Choose a reason for hiding this comment

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

Bug: Hardcoded level transition setMap(levels[1]) lacks bounds checking and proper win condition handling.
Severity: HIGH | Confidence: 0.95

🔍 Detailed Analysis

The game hardcodes setMap(levels[1]) on line 145 without checking if levels[1] exists or if it's the final level. This leads to several issues: 1) If levels[1] is ever removed or becomes undefined, calling setMap(undefined) could cause unexpected behavior or a crash. 2) When the player completes the final level (level 1), the game enters an infinite loop where setMap(levels[1]) is repeatedly called on every subsequent input, preventing a win message and creating a poor user experience. 3) The level variable declared on line 88 is unused, indicating an incomplete level progression system.

💡 Suggested Fix

Implement a proper level progression system using the level variable. Increment level after completing a map, check if (levels[level] !== undefined) before calling setMap(levels[level]), and display a win message if no more levels exist.

🤖 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/Rock_Puzzle_Game.js#L145

Potential issue: The game hardcodes `setMap(levels[1])` on line 145 without checking if
`levels[1]` exists or if it's the final level. This leads to several issues: 1) If
`levels[1]` is ever removed or becomes `undefined`, calling `setMap(undefined)` could
cause unexpected behavior or a crash. 2) When the player completes the final level
(level 1), the game enters an infinite loop where `setMap(levels[1])` is repeatedly
called on every subsequent input, preventing a win message and creating a poor user
experience. 3) The `level` variable declared on line 88 is unused, indicating an
incomplete level progression system.

Did we get this right? 👍 / 👎 to inform future reviews.

Reference_id: 2712137

Copy link
Author

Choose a reason for hiding this comment

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

There are only 2 levels, so I'm not sure what I could do better regarding this. Nothing edits the amount of levels.

Copy link
Author

Choose a reason for hiding this comment

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

I removed the level vairable

@whatwareweb
Copy link
Collaborator

Please update the date in your metadata!

@whatwareweb whatwareweb added the triaged This PR has been triaged - awaiting reviewer label Nov 16, 2025
@5ghzx
Copy link
Author

5ghzx commented Nov 16, 2025

@whatwareweb i have done so

@whatwareweb
Copy link
Collaborator

ok metadata looks good, a reviewer will check your game soon, thank you!

@whatwareweb whatwareweb added the awaiting-review Preliminary metadata check is complete, awaiting. review! label Nov 16, 2025
Copy link
Collaborator

@whatwareweb whatwareweb left a comment

Choose a reason for hiding this comment

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

Hello, please add some more content to this game to justify a Sprig device grant. Some ideas are more levels, more unique game mechanics, more artwork, music etc.

@whatwareweb whatwareweb self-assigned this Nov 16, 2025
@whatwareweb
Copy link
Collaborator

whatwareweb commented Nov 16, 2025

Reminder your game has to have more than a minute of gameplay, preferably even more than that.

@5ghzx
Copy link
Author

5ghzx commented Nov 16, 2025

@whatwareweb is simply adding more levels sufficient?

@whatwareweb
Copy link
Collaborator

More levels would be good, but just more content in general. the thing i am looking for the most is unique game mechanics so if you can add some more advanced game mechanics in your new levels that would be the best

@5ghzx
Copy link
Author

5ghzx commented Nov 18, 2025

Okay, @whatwareweb I have added the ability to reset the level with J. As well, there is an additional level. Should I add more levels?

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

Labels

awaiting-review Preliminary metadata check is complete, awaiting. review! triaged This PR has been triaged - awaiting reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants