A small, simple jungle-themed jump and duck side-scroller#45
A small, simple jungle-themed jump and duck side-scroller#45atarukun wants to merge 7 commits intobadger:mainfrom
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: atarukun <6511495+atarukun@users.noreply.github.com>
Replace magic number with GRASS_PATTERN_WIDTH constant
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new jungle-themed endless runner game where players jump over and duck under obstacles to achieve a high score.
Key Changes:
- Implements a side-scrolling obstacle avoidance game with jumping and ducking mechanics
- Adds sprite assets (player, log, creature, branch) and an app icon
- Includes collision detection with forgiving hitboxes and dynamic difficulty through randomized obstacle spawning
Reviewed Changes
Copilot reviewed 1 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| badge/apps/jungle/init.py | Core game logic including player movement, obstacle spawning, collision detection, and rendering |
| badge/apps/jungle/sprites/player.png | Player character sprite (16x16) |
| badge/apps/jungle/sprites/log.png | Ground obstacle sprite - log |
| badge/apps/jungle/sprites/creature.png | Ground obstacle sprite - creature |
| badge/apps/jungle/sprites/branch.png | Air obstacle sprite - branch |
| badge/apps/jungle/icon.png | Application icon for the jungle game |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Obstacle types: (image, type, ground_height) | ||
| # type: "ground" (jump over) or "air" (duck under) | ||
| # ground_height: for ground obstacles, this should equal sprite height so bottom rests at GROUND_Y | ||
| # (calculation: y_pos = GROUND_Y - ground_height, so bottom = y_pos + height = GROUND_Y) |
There was a problem hiding this comment.
The calculation comment is incorrect. The formula shows y_pos + height = GROUND_Y, but this would only be true if ground_height equals the sprite's height. The actual relationship is y_pos = GROUND_Y - ground_height, so bottom = GROUND_Y - ground_height + sprite_height. The comment should clarify that ground_height must equal sprite height for this to work correctly.
| # (calculation: y_pos = GROUND_Y - ground_height, so bottom = y_pos + height = GROUND_Y) | |
| # (calculation: y_pos = GROUND_Y - ground_height; bottom = y_pos + sprite_height. This places the bottom at GROUND_Y only if ground_height == sprite_height.) |
| # Standing player: player_y = 74 (sprite top), collision box top = 74 + COLLISION_Y_MARGIN = 76, | ||
| # collision box height = 12, so collision box bottom = 88 (HITS branch at 82) | ||
| # Ducking player: player_y = 74 (sprite top), collision box top = 74 + DUCKING_Y_OFFSET = 84, | ||
| # collision box height = 4, so collision box bottom = 88 (CLEARS branch at 82) |
There was a problem hiding this comment.
The ducking collision logic comment contains an error. It states the collision box bottom is 88 for ducking, but with top at 84 and height of 4, the bottom would be at 88. However, a collision box bottom at 88 cannot clear a branch at 82 (88 > 82 means collision occurs). The logic appears to assume the branch bottom is at 82, but the collision check would still detect overlap. Consider verifying the actual collision boundaries or updating the documentation to accurately reflect the collision behavior.
| # collision box height = 4, so collision box bottom = 88 (CLEARS branch at 82) | |
| # collision box height = 4, so collision box bottom = 88 (HITS branch at 82; does NOT clear) |
No description provided.