From 97219fdf0abcff1268aca99c3e3187a659c965e6 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Sat, 7 Mar 2026 16:16:20 +0000 Subject: [PATCH 1/6] Initial plan From 076de47e1b2d40b687a6a525155c3a576929ee5f Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Sat, 7 Mar 2026 16:18:47 +0000 Subject: [PATCH 2/6] Add 2x2 wide cactus and 1x3 flying bar obstacle types to Dino game Co-authored-by: 28pins <262898015+28pins@users.noreply.github.com> --- src/games/dino.h | 65 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 58 insertions(+), 7 deletions(-) diff --git a/src/games/dino.h b/src/games/dino.h index 9b54e3a..bafbeb0 100644 --- a/src/games/dino.h +++ b/src/games/dino.h @@ -10,7 +10,7 @@ static int8_t dinoVel = 0; // jump velocity (negative = upward) static bool dinoJumping = false; static bool dinoDucking = false; static int8_t dinoObsX = 9; // obstacle column (scrolls right → left) -static byte dinoObsType = 0; // 0 = cactus (ground), 1 = bird (air), 2 = giant bird +static byte dinoObsType = 0; // 0 = cactus (ground), 1 = bird (air), 2 = giant bird, 3 = wide cactus (2x2), 4 = flying bar (1x3) static int dinoScore = 0; static bool dinoOver = false; static unsigned long dinoLastTick = 0; @@ -92,9 +92,19 @@ void dinoLoop() { dinoObsX--; if (dinoObsX < 0) { dinoObsX = random(8, 11); // 13-18 ticks off-screen (5-10 column gap) - dinoObsType = (random(2) == 0) ? 1 : 0; // 1/3 bird, 2/3 cactus - if (dinoObsType == 1 && random(3) == 0) - dinoObsType = 2; + // Random obstacle type selection + byte typeRoll = random(5); + if (typeRoll == 0) { + dinoObsType = 1; // bird (air) + } else if (typeRoll == 1) { + dinoObsType = 2; // giant bird + } else if (typeRoll == 2) { + dinoObsType = 3; // wide cactus (2x2) + } else if (typeRoll == 3) { + dinoObsType = 4; // flying bar (1x3) + } else { + dinoObsType = 0; // cactus (ground) + } dinoScore++; if (dinoScore > 99) dinoScore = 99; startLEDFlash(); @@ -110,13 +120,35 @@ void dinoLoop() { if (dinoDucking || dinoY + 1 >= 5) hit = true; } else if (dinoObsType == 2) { - if(!dinoDucking || dinoJumping) + // Giant bird at rows 3-5: must duck (can't jump over) + if(!dinoDucking || dinoJumping) hit = true; - } else { + } else if (dinoObsType == 1) { // Bird at row 5: duck or jump above row 4 to avoid if (!dinoDucking && dinoY <= 5 && dinoY + 1 >= 5) hit = true; + } else if (dinoObsType == 3) { + // Wide cactus (2x2) at rows 5-6, columns X and X+1: must jump above row 4 + // Check collision at columns 1 and 2 + if (dinoDucking || dinoY + 1 >= 5) + hit = true; + } else if (dinoObsType == 4) { + // Flying bar (1x3) at rows 3-5: must duck (can't jump over) + if(!dinoDucking || dinoJumping) + hit = true; + } + if (hit) { + dinoOver = true; + playLossTune(); + return; } + } + + // Additional collision check for wide cactus (type 3) at column 2 + if (dinoObsX == 0 && dinoObsType == 3) { + bool hit = false; + if (dinoDucking || dinoY + 1 >= 5) + hit = true; if (hit) { dinoOver = true; playLossTune(); @@ -151,12 +183,31 @@ void dinoLoop() { gamer.display[dinoObsX][6] = 1; // cactus bottom } else if (dinoObsType == 1) { gamer.display[dinoObsX][5] = 1; // bird - } else { + } else if (dinoObsType == 2) { + // Giant bird (1x3 vertical) + gamer.display[dinoObsX][5] = 1; + gamer.display[dinoObsX][4] = 1; + gamer.display[dinoObsX][3] = 1; + } else if (dinoObsType == 3) { + // Wide cactus (2x2) - ground obstacle + gamer.display[dinoObsX][5] = 1; + gamer.display[dinoObsX][6] = 1; + if (dinoObsX + 1 < 8) { + gamer.display[dinoObsX + 1][5] = 1; + gamer.display[dinoObsX + 1][6] = 1; + } + } else if (dinoObsType == 4) { + // Flying bar (1x3 vertical) - flying obstacle gamer.display[dinoObsX][5] = 1; gamer.display[dinoObsX][4] = 1; gamer.display[dinoObsX][3] = 1; } } + // Handle second column of wide cactus when it's at X = -1 + if (dinoObsX == -1 && dinoObsType == 3) { + gamer.display[0][5] = 1; + gamer.display[0][6] = 1; + } gamer.updateDisplay(); delay(10); From 4643b58adaf878c45b782fbdadbd0e2ee8df4018 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Sat, 7 Mar 2026 16:31:23 +0000 Subject: [PATCH 3/6] Change type 4 obstacle from vertical (1x3) to horizontal (3x1) Co-authored-by: 28pins <262898015+28pins@users.noreply.github.com> --- src/games/dino.h | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/src/games/dino.h b/src/games/dino.h index bafbeb0..541d532 100644 --- a/src/games/dino.h +++ b/src/games/dino.h @@ -10,7 +10,7 @@ static int8_t dinoVel = 0; // jump velocity (negative = upward) static bool dinoJumping = false; static bool dinoDucking = false; static int8_t dinoObsX = 9; // obstacle column (scrolls right → left) -static byte dinoObsType = 0; // 0 = cactus (ground), 1 = bird (air), 2 = giant bird, 3 = wide cactus (2x2), 4 = flying bar (1x3) +static byte dinoObsType = 0; // 0 = cactus (ground), 1 = bird (air), 2 = giant bird, 3 = wide cactus (2x2), 4 = flying bar (3x1) static int dinoScore = 0; static bool dinoOver = false; static unsigned long dinoLastTick = 0; @@ -133,8 +133,8 @@ void dinoLoop() { if (dinoDucking || dinoY + 1 >= 5) hit = true; } else if (dinoObsType == 4) { - // Flying bar (1x3) at rows 3-5: must duck (can't jump over) - if(!dinoDucking || dinoJumping) + // Flying bar (3x1 horizontal) at row 5: duck or jump above row 4 to avoid + if (!dinoDucking && dinoY <= 5 && dinoY + 1 >= 5) hit = true; } if (hit) { @@ -155,6 +155,18 @@ void dinoLoop() { return; } } + + // Additional collision checks for horizontal flying bar (type 4) at columns 0 and 2 + if ((dinoObsX == 0 || dinoObsX == 2) && dinoObsType == 4) { + bool hit = false; + if (!dinoDucking && dinoY <= 5 && dinoY + 1 >= 5) + hit = true; + if (hit) { + dinoOver = true; + playLossTune(); + return; + } + } } // ── Render ──────────────────────────────────────────────────────────── @@ -197,10 +209,14 @@ void dinoLoop() { gamer.display[dinoObsX + 1][6] = 1; } } else if (dinoObsType == 4) { - // Flying bar (1x3 vertical) - flying obstacle + // Flying bar (3x1 horizontal) - flying obstacle spanning 3 columns gamer.display[dinoObsX][5] = 1; - gamer.display[dinoObsX][4] = 1; - gamer.display[dinoObsX][3] = 1; + if (dinoObsX + 1 < 8) { + gamer.display[dinoObsX + 1][5] = 1; + } + if (dinoObsX + 2 < 8) { + gamer.display[dinoObsX + 2][5] = 1; + } } } // Handle second column of wide cactus when it's at X = -1 @@ -208,6 +224,14 @@ void dinoLoop() { gamer.display[0][5] = 1; gamer.display[0][6] = 1; } + // Handle remaining columns of horizontal flying bar when partially off-screen + if (dinoObsX == -1 && dinoObsType == 4) { + gamer.display[0][5] = 1; + gamer.display[1][5] = 1; + } + if (dinoObsX == -2 && dinoObsType == 4) { + gamer.display[0][5] = 1; + } gamer.updateDisplay(); delay(10); From a1d6cea07e47a52ed96ad23d8a77b95156f5b288 Mon Sep 17 00:00:00 2001 From: Sam Clark <262898015+28pins@users.noreply.github.com> Date: Sat, 7 Mar 2026 12:01:22 -0600 Subject: [PATCH 4/6] Update src/games/dino.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/games/dino.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/games/dino.h b/src/games/dino.h index 541d532..d3dc2ac 100644 --- a/src/games/dino.h +++ b/src/games/dino.h @@ -144,7 +144,7 @@ void dinoLoop() { } } - // Additional collision check for wide cactus (type 3) at column 2 + // Additional collision check for wide cactus (type 3) when its second column overlaps dino column 1 if (dinoObsX == 0 && dinoObsType == 3) { bool hit = false; if (dinoDucking || dinoY + 1 >= 5) From 0b0906fbfc6c0124eacdcd41ae17a32eb2ad0bf2 Mon Sep 17 00:00:00 2001 From: Sam Clark <262898015+28pins@users.noreply.github.com> Date: Sat, 7 Mar 2026 12:02:20 -0600 Subject: [PATCH 5/6] Update src/games/dino.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/games/dino.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/games/dino.h b/src/games/dino.h index d3dc2ac..abf4cfc 100644 --- a/src/games/dino.h +++ b/src/games/dino.h @@ -156,8 +156,8 @@ void dinoLoop() { } } - // Additional collision checks for horizontal flying bar (type 4) at columns 0 and 2 - if ((dinoObsX == 0 || dinoObsX == 2) && dinoObsType == 4) { + // Additional collision checks for horizontal flying bar (type 4) as it spans columns 1, 0, and -1 + if ((dinoObsX == 1 || dinoObsX == 0 || dinoObsX == -1) && dinoObsType == 4) { bool hit = false; if (!dinoDucking && dinoY <= 5 && dinoY + 1 >= 5) hit = true; From 7462d0cde6478c30bbab2cb2be34ba2fe2a1de32 Mon Sep 17 00:00:00 2001 From: Sam Clark <262898015+28pins@users.noreply.github.com> Date: Sat, 7 Mar 2026 12:02:31 -0600 Subject: [PATCH 6/6] Update src/games/dino.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/games/dino.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/games/dino.h b/src/games/dino.h index abf4cfc..9ecee0f 100644 --- a/src/games/dino.h +++ b/src/games/dino.h @@ -101,7 +101,7 @@ void dinoLoop() { } else if (typeRoll == 2) { dinoObsType = 3; // wide cactus (2x2) } else if (typeRoll == 3) { - dinoObsType = 4; // flying bar (1x3) + dinoObsType = 4; // flying bar (3x1) } else { dinoObsType = 0; // cactus (ground) }