Skip to content

Change Dino obstacle type 4 from vertical (1x3) to horizontal (3x1)#75

Merged
28pins merged 6 commits into
mainfrom
claude/add-new-obstacle-types
Mar 7, 2026
Merged

Change Dino obstacle type 4 from vertical (1x3) to horizontal (3x1)#75
28pins merged 6 commits into
mainfrom
claude/add-new-obstacle-types

Conversation

@Claude

@Claude Claude AI commented Mar 7, 2026

Copy link
Copy Markdown

Obstacle type 4 ("flying bar") was originally implemented as a 1 column × 3 rows vertical obstacle. This changes it to a 3 columns × 1 row horizontal obstacle at row 5.

Changes

  • Comment: Updated type 4 description from (1x3) to (3x1)
  • Collision detection: Changed from tall vertical obstacle (must duck) to single-row horizontal obstacle (duck or jump to avoid)
    • Added collision checks at dinoObsX == 0 and dinoObsX == 2 for the extended horizontal span
  • Rendering: Changed from drawing 3 vertical pixels (rows 3-5) to 3 horizontal pixels (columns X, X+1, X+2) at row 5
  • Edge cases: Added rendering for positions X=-1 and X=-2 to handle partial off-screen visibility

The obstacle now behaves similarly to type 1 (bird) in terms of collision mechanics, but spans 3 columns instead of 1.

Original prompt

Add another obstacle type that is a 2x2 and one that is a 1x3 (flying) in the Dino game

Co-authored-by: 28pins <262898015+28pins@users.noreply.github.com>
@Claude Claude AI changed the title [WIP] Add new 2x2 and 1x3 obstacle types to Dino game Add 2x2 wide cactus and 1x3 flying bar obstacle types to Dino game Mar 7, 2026
Co-authored-by: 28pins <262898015+28pins@users.noreply.github.com>
@Claude Claude AI changed the title Add 2x2 wide cactus and 1x3 flying bar obstacle types to Dino game Change Dino obstacle type 4 from vertical (1x3) to horizontal (3x1) Mar 7, 2026
@28pins 28pins self-requested a review March 7, 2026 16:32
@28pins 28pins marked this pull request as ready for review March 7, 2026 17:58
Copilot AI review requested due to automatic review settings March 7, 2026 17:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the Dino Runner mini-game obstacle set by redefining obstacle type 4 (“flying bar”) to be a horizontal 3×1 obstacle at row 5, along with corresponding collision and rendering adjustments.

Changes:

  • Expanded obstacle type definitions to include wide cactus (type 3) and flying bar (type 4).
  • Updated collision detection logic to account for multi-column obstacles.
  • Updated rendering logic to draw multi-column obstacles and handle partial off-screen visibility.

Comment thread src/games/dino.h Outdated
Comment thread src/games/dino.h Outdated
Comment thread src/games/dino.h Outdated

@28pins 28pins left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looks good

28pins and others added 3 commits March 7, 2026 12:01
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@28pins 28pins merged commit 14d2fce into main Mar 7, 2026
2 checks passed
@28pins 28pins deleted the claude/add-new-obstacle-types branch March 11, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants