[Sprig App] BreakYourHead#3510
Conversation
|
|
||
| const targetTile = getTile(nextX, nextY) || [] | ||
|
|
||
| const isSolid = targetTile.some(s => [wall, ghost].includes(s.type))e)) |
Bug: The move function's collision check at games/BreakYourHead.js:328 omits box from solid types, allowing the player to walk through boxes.
Severity: CRITICAL | Confidence: High
🔍 Detailed Analysis
The custom move function at games/BreakYourHead.js:328 incorrectly determines solid obstacles. It checks for wall and ghost types but omits box types, despite box being declared as solid via setSolids. This allows the player to walk through boxes instead of pushing them, bypassing the intended game mechanics. Consequently, box-pushing puzzles in levels 2, 3, and 4 cannot be completed, rendering the game unplayable past Level 1.
💡 Suggested Fix
Modify line 328 in games/BreakYourHead.js to include box in the solid obstacle check: const isSolid = targetTile.some(s => [wall, box, ghost].includes(s.type))e)). Alternatively, remove the custom move function and rely on the Sprig engine's built-in collision handling.
🤖 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/BreakYourHead.js#L328
Potential issue: The custom `move` function at `games/BreakYourHead.js:328` incorrectly
determines solid obstacles. It checks for `wall` and `ghost` types but omits `box`
types, despite `box` being declared as solid via `setSolids`. This allows the player to
walk through `boxes` instead of pushing them, bypassing the intended game mechanics.
Consequently, box-pushing puzzles in levels 2, 3, and 4 cannot be completed, rendering
the game unplayable past Level 1.
st Level 1.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 5980525
It works perfectly, once the box is included, the box stops moving as i have already mentioned all of that at line 312 to 315 (setSolids([player, wall, door, box, ghost])
setPushables({{
[player]: [box]]
})))
|
Thanks for your submission! Please update according to my comments before this can be approved |
Pull request overview
A new Sprig game called "BreakYourHead" — a puzzle game with mechanics including keys/doors, ice sliding, box pushing, spikes, ghosts, and portals across multiple levels.
Changes:
- Adds a new game file with 4 puzzle levels featuring various game mechanics
- Includes sound effects for key pickup, door opening, spikes, ghost encounters, and winning
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| const levels = [ | ||
| map` | ||
| wwwwwwww | ||
| [email protected] | ||
| wwwwwiiw | ||
| w......w | ||
| w.k..p.w | ||
| wwwwwwww`, | ||
| map` | ||
| wwwwwwww | ||
| [email protected] | ||
| w.wwwwww | ||
| w.w..g.w | ||
| w...p..w | ||
| wwwwwwww`, | ||
| map` | ||
| wwwwwwwww | ||
| [email protected]..._w | ||
| w..wfw.bw | ||
| ws..dw.fw | ||
| wfswiwiiw | ||
| wiwwswwdw | ||
| wf......w | ||
| wp.wk...w | ||
| wwwwwwwww`, | ||
| map` | ||
| wwwwwwwww | ||
| [email protected] | ||
| wdww..www | ||
| w....b..w | ||
| wwws.swdw | ||
| w.iiii..w | ||
| wgp._k..w | ||
| wwwwwwwww` | ||
| ] |
Copilot commented on Mar 16on Mar 16, 2026
- Medium
| if (g.x === p.x && g.y === p.y) {= p.y) { | ||
| playTune(tuneGhost) | ||
| addText("CAUGHT!", {x: p.x, y: p.y - 1, color: color`0`}) | ||
| setTimeout(() => loadLevel(currentLevel), 500)00) | ||
| } |
Copilot commented on Mar 16on Mar 16, 2026
- High
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
429 | | - | |
| 429 | + | |
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
| @@ -0,0 +1,442 @@ | |||
| /* | |||
| @title: Dungeon_Escape | |||
Copilot commented on Mar 16on Mar 16, 2026
- Medium
| @@ -0,0 +1,442 @@ | |||
| /* | |||
| @title: Dungeon_Escape | |||
| @author: Azmeer Pirani | |||
Copilot commented on Mar 16on Mar 16, 2026
- Medium
|
One more thing, it looks like your file name and game name are different. Can you use the same name? |
Done, I have changed the game name to the file name, thank you! |
|
Looks good, this has passed my initial review and I will mark it for final review. |
It is, I'll change it! |
❌ [Auto Triage] Submission Issues Found |
|
Hello! Please fix the issues as described by the bot above before we can review your game. If you have any questions please let us know. |
Updated game metadata including description, tags, and added date.
|
@Sudo-Aju is attempting to deploy a commit to the Hack Club Team on Vercel. A member of the Team first needs to authorize it. |
✅ [Auto Triage] Submission Verified[TOOLS]
|
|
Game looks good! |
|
Thanks for your submission! If you're a teen, you can get your Sprig here! sprig-order.hackclub.dev Hack Clubbers would love to see this! Just post a link and 1-2 sentences talking about your game to our #ship channel |
Author name
Author: Sudo-Aju
About your game
What is your game about?
Navigate five levels of puzzles and traps. Push boxes, slide on ice, and outsmart stalking ghosts to reach the portal. A unique blend of logic, physics, and survival..
How do you play your game?
Use W, A, S, D to move. Reach the Portal (@) to advance. Collect Keys (k) for doors and push Boxes (b) onto Plates (_) to unlock paths. Plan carefully—Ice (i) causes uncontrollable sliding! Avoid deadly Spikes (s) and the stalking Ghost (g) or the level restarts..