Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions badge/apps/jungle/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
OBSTACLE_SPAWN_MAX = 120
OBSTACLE_REMOVAL_THRESHOLD = -50 # X position at which off-screen obstacles are removed
AIR_GAP = 8 # Vertical gap above ground that the branch bottom sits at (duck to clear)
GRASS_PATTERN_WIDTH = 8 # Width of the repeating grass pattern

# Collision box adjustments for forgiving gameplay
COLLISION_MARGIN = 2 # Pixels reduced from each side of collision boxes
Expand Down Expand Up @@ -222,8 +223,8 @@ def draw_game():

# Draw grass pattern on ground
screen.brush = GRASS_COLOR
for i in range(0, WIDTH, 8):
offset = (state["scroll_offset"] + i) % 8
for i in range(0, WIDTH, GRASS_PATTERN_WIDTH):
offset = (state["scroll_offset"] + i) % GRASS_PATTERN_WIDTH
screen.draw(shapes.rectangle(i - offset, GROUND_Y, 4, 2))

# Draw obstacles
Expand Down
Loading