-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[Sprig App] Paws Up! #3508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[Sprig App] Paws Up! #3508
Conversation
| onInput("w", () => { | ||
| if (isGrounded()) { | ||
| if (getFirst(player).y < 2) { | ||
| getFirst(player).y -= 1; | ||
| } else if (getFirst(player).y < 3) { | ||
| getFirst(player).y -= 2; | ||
| } | ||
|
|
||
| getFirst(player).y -= 3 | ||
| } | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: The jump logic incorrectly applies a -3 Y-offset unconditionally, leading to inconsistent and unintended jump heights.
Severity: CRITICAL | Confidence: High
🔍 Detailed Analysis
The getFirst(player).y -= 3 statement on line 255 is incorrectly indented, causing it to always execute when isGrounded() is true, regardless of the preceding if/else if block. This leads to inconsistent jump heights: 4 tiles up if y < 2, 5 tiles up if 2 <= y < 3, and 3 tiles up if y >= 3. This breaks core platformer logic and makes gameplay unpredictable.
💡 Suggested Fix
Restructure the jump logic to ensure getFirst(player).y -= 3 is applied conditionally, perhaps within an else block, or combine the conditional offsets into single statements to prevent double application.
🤖 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/Paws-Up!.js#L247-L257
Potential issue: The `getFirst(player).y -= 3` statement on line 255 is incorrectly
indented, causing it to always execute when `isGrounded()` is true, regardless of the
preceding `if/else if` block. This leads to inconsistent jump heights: 4 tiles up if `y
< 2`, 5 tiles up if `2 <= y < 3`, and 3 tiles up if `y >= 3`. This breaks core
platformer logic and makes gameplay unpredictable.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 5945550
| addText(total.toString(), { | ||
| x: 17, | ||
| y: 1, | ||
| color: color`0`, | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Score text is rendered off-screen at x: 17 because game maps are only 10 tiles wide, making the score invisible.
Severity: CRITICAL | Confidence: High
🔍 Detailed Analysis
The score text is rendered at x: 17 in addText calls (lines 327-331, 289-293, 345-349). All game maps are only 10 tiles wide (valid x-coordinates 0-9). This causes the score to be rendered completely off-screen and invisible to the player, breaking a critical UI element.
💡 Suggested Fix
Adjust the x coordinate for addText calls displaying the score to be within the visible map width (e.g., x: 0 to x: 9).
🤖 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/Paws-Up!.js#L289-L293
Potential issue: The score text is rendered at `x: 17` in `addText` calls (lines
327-331, 289-293, 345-349). All game maps are only 10 tiles wide (valid x-coordinates
0-9). This causes the score to be rendered completely off-screen and invisible to the
player, breaking a critical UI element.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 5945550
Author name
Author: HomousMan
About your game
What is your game about?
Your a cat Jumping Through The World!
How do you play your game?
Thumbnail Or In Game