Skip to content

[Sprig App] BreakYourHead#3510

Merged
whatwareweb merged 8 commits into
hackclub:mainfrom
Sudo-Aju:Automated-PR-1765101517474
Apr 7, 2026
Merged

[Sprig App] BreakYourHead#3510
whatwareweb merged 8 commits into
hackclub:mainfrom
Sudo-Aju:Automated-PR-1765101517474

Conversation

@Sudo-Aju
Copy link
Copy Markdown
Contributor

@Sudo-Aju Sudo-Aju commented Dec 7, 2025

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..

games/BreakYourHead.js

const targetTile = getTile(nextX, nextY) || []

const isSolid = targetTile.some(s => [wall, ghost].includes(s.type))e))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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]]
})))

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
games/BreakYourHead.js Outdated
@theamazing0
Copy link
Copy Markdown
Contributor

Thanks for your submission! Please update according to my comments before this can be approved

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copilot AI review requested due to automatic review settings March 16, 2026 20:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

games/BreakYourHead.js
Comment on lines +263 to +297
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 16, 2026

  • Medium

The PR description states "Navigate five levels of puzzles and traps" but the code only contains 4 levels (indices 0-3 in the levels array).

Copilot uses AI. Check for mistakes.
games/BreakYourHead.js
Comment on lines +436 to +440
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 16, 2026

  • High

The move function treats ghost as a solid wall (line 329), preventing the player from moving into a ghost's tile. However, in afterInput, the ghost moves toward the player and checks collision after moving (line 436). If the ghost moves onto the player's tile, the player gets caught. But if the player moves toward the ghost, the player is simply blocked. This asymmetry means the ghost collision in afterInput (line 436) can never trigger when the ghost moves onto the player's current position in the same tick, because the ghost is also solid (set in setSolids), so g.x += moveX won't move it onto the player's tile either. The ghost and player can never occupy the same tile, making the ghost catch logic on line 436 unreachable. Consider removing ghost from setSolids or from the solid check in move, and instead handling ghost collision explicitly.

Suggested changeset  (1);(1)
games/BreakYourHead.js
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@
426426
const targetY = g.y + moveY
427427
const targetTile = getTile(targetX, targetY) || []
428428
429-
const isBlocked = targetTile.some(s =>gt; [wall, box, door, ghost].includes(s.type))
429+
const isBlocked = targetTile.some(s =>gt; [wall, box, door].includes(s.type))
430430
431431
if (!isBlocked) {
432432
g.x += moveX
Unable to commit as this autofix suggestion is now outdated.
Copilot uses AI. Check for mistakes.
games/BreakYourHead.js Outdated
@@ -0,0 +1,442 @@
/*
@title: Dungeon_Escape

Copilot commented on Mar 16, 2026

  • Medium

The @title in the file header is "Dungeon_Escape" but the file is named "BreakYourHead.js" and the PR title is "BreakYourHead". These should be consistent.

Copilot uses AI. Check for mistakes.
games/BreakYourHead.js
@@ -0,0 +1,442 @@
/*
@title: Dungeon_Escape
@author: Azmeer Pirani

Copilot commented on Mar 16, 2026

  • Medium

The @author is "Azmeer Pirani" but the PR description says the author is "Sudo-Aju". These should match.

Copilot uses AI. Check for mistakes.
@theamazing0
Copy link
Copy Markdown
Contributor

One more thing, it looks like your file name and game name are different. Can you use the same name?

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@Sudo-Aju
Copy link
Copy Markdown
Contributor Author

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!

@theamazing0
Copy link
Copy Markdown
Contributor

Looks good, this has passed my initial review and I will mark it for final review.

@LucasHT22 LucasHT22 added triaged This PR has been triaged - awaiting reviewer and removed awaiting-triage labels Mar 23, 2026
Copy link
Copy Markdown
Member

@LucasHT22 LucasHT22 left a comment

Choose a reason for hiding this comment

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

Hey! Is your game image AI generated? If yes, please change:)

@Sudo-Aju
Copy link
Copy Markdown
Contributor Author

Hey! Is your game image AI generated? If yes, please change:)

It is, I'll change it!

Sudo-Aju added ed 2 commits March 24, 2026 01:22

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link
Copy Markdown
Contributor Author

@Sudo-Aju Sudo-Aju left a comment

Choose a reason for hiding this comment

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

I have removed the thumbnail

games/BreakYourHead.js Outdated
@Sudo-Aju Sudo-Aju requested a review from rom LucasHT22 March 23, 2026 20:10
@whatwareweb whatwareweb added the the submission Game submission label Apr 6, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 6, 2026

❌ [Auto Triage] Submission Issues Found

- The metadata header in "BreakYourHead.js" is missing or formatted incorrectly. Check the template!

@whatwareweb
Copy link
Copy Markdown
Collaborator

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.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Updated game metadata including description, tags, and added date.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 6, 2026

@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.

Copy link
Copy Markdown
Contributor Author

@Sudo-Aju Sudo-Aju left a comment

Choose a reason for hiding this comment

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

i have changed the metadata

@whatwareweb whatwareweb added submission Game submission and removed submission Game submission labels Apr 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

✅ [Auto Triage] Submission Verified

Everything looks great! Your submission is ready be reviewed.

[TOOLS]

@whatwareweb
Copy link
Copy Markdown
Collaborator

Game looks good!

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@whatwareweb whatwareweb merged commit mit 08d7a94 into hackclub:main Apr 7, 2026
1 check failed
@whatwareweb
Copy link
Copy Markdown
Collaborator

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

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

Labels

submission Game submission triaged This PR has been triaged - awaiting reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

None yet

5 participants