Skip to content

Add Flappy Bird web clone#32

Draft
pallaviraiturkar0 with Copilot wants to merge 2 commits into
mainfrom
copilot/featureflappy-bird-web
Draft

Add Flappy Bird web clone#32
pallaviraiturkar0 with Copilot wants to merge 2 commits into
mainfrom
copilot/featureflappy-bird-web

Conversation

Copilot AI commented Dec 1, 2025

Copy link
Copy Markdown

Browser-based Flappy Bird clone using Canvas 2D API and vanilla ES6 JavaScript. No build step required—open index.html to play.

Files Added

  • index.html — Canvas element, score header, start/game-over overlays
  • styles.css — Responsive layout, mobile-friendly viewport
  • src/main.js — Game logic in IIFE pattern:
    • requestAnimationFrame game loop
    • Bird physics (gravity, flap impulse, rotation)
    • Pipe generation with randomized gaps
    • Collision detection (pipes/ground/ceiling)
    • Score + localStorage high score persistence
    • Web Audio API sound effects
  • assets/README.md — Placeholder for custom sprites/audio
  • LICENSE — MIT

Controls

  • Space / Click / Tap — Flap

Screenshots

Start Screen Game Over
Start Game Over
Original prompt

Create a new feature branch named feature/flappy-bird-web and open a pull request that implements a simple Flappy Bird web clone playable in the browser.

Requirements and acceptance criteria:

  1. Project structure (add these files):

    • index.html: minimal HTML shell with a full-window canvas element and a simple header showing title and score.
    • styles.css: basic layout, centering, mobile-friendly viewport meta tag.
    • src/main.js: all game logic (no build step) using plain ES6 JavaScript. Implement the following subsystems:
      • Game loop using requestAnimationFrame.
      • Bird physics: gravity, flap impulse, max fall speed, rotation for visuals.
      • Input: spacebar / click / touch to flap.
      • Pipes: generate pairs of pipes at a fixed interval with randomized vertical gap position; move leftward; remove off-screen pipes.
      • Collision detection between bird and pipes or ground/ceiling.
      • Score: increment when bird passes a pipe; persist high score in localStorage.
      • Restart: show a game-over overlay with final score and a button (or tap) to restart.
      • Simple sound effects (optional) — acceptable to include short encoded audio files or use WebAudio for simple beeps.
    • assets/: placeholder for sprites or audio (can be left empty if using simple shapes and built-in audio generation).
    • README.md: brief instructions on how to run the game locally (open index.html) and controls.
  2. Game visuals/UX:

    • Pixel-art or simple vector graphics (rectangles and circles acceptable).
    • Responsive layout: canvas should scale to fit mobile and desktop while maintaining aspect ratio (e.g., virtual internal resolution 288x512 scaled to fit).
    • Show current score during play and display high score after game over.
  3. Code quality:

    • Use clear, commented code with small functions and an IIFE or module pattern to avoid globals.
    • No external libraries required.
    • Include an SPDX license header at the top of each source file and add a LICENSE file (MIT).
  4. Pull request details:

    • PR branch: feature/flappy-bird-web
    • Base branch: leave as default branch (do not specify if unknown)
    • PR title: "Add Flappy Bird web clone"
    • PR description: include a short summary of features, files added, usage instructions, and testing notes.

Notes for the implementer (developer):

  • Keep the implementation simple and self-contained so reviewers can play the game by opening index.html in the browser.
  • Prefer using canvas 2D API and built-in browser features to avoid bundlers.
  • If any assets (images or audio) are added, keep them small and place them under assets/.

Do not assign an assignee. Do not reference any images (none were uploaded).

This pull request was created as a result of the following prompt from Copilot chat.

Create a new feature branch named feature/flappy-bird-web and open a pull request that implements a simple Flappy Bird web clone playable in the browser.

Requirements and acceptance criteria:

  1. Project structure (add these files):

    • index.html: minimal HTML shell with a full-window canvas element and a simple header showing title and score.
    • styles.css: basic layout, centering, mobile-friendly viewport meta tag.
    • src/main.js: all game logic (no build step) using plain ES6 JavaScript. Implement the following subsystems:
      • Game loop using requestAnimationFrame.
      • Bird physics: gravity, flap impulse, max fall speed, rotation for visuals.
      • Input: spacebar / click / touch to flap.
      • Pipes: generate pairs of pipes at a fixed interval with randomized vertical gap position; move leftward; remove off-screen pipes.
      • Collision detection between bird and pipes or ground/ceiling.
      • Score: increment when bird passes a pipe; persist high score in localStorage.
      • Restart: show a game-over overlay with final score and a button (or tap) to restart.
      • Simple sound effects (optional) — acceptable to include short encoded audio files or use WebAudio for simple beeps.
    • assets/: placeholder for sprites or audio (can be left empty if using simple shapes and built-in audio generation).
    • README.md: brief instructions on how to run the game locally (open index.html) and controls.
  2. Game visuals/UX:

    • Pixel-art or simple vector graphics (rectangles and circles acceptable).
    • Responsive layout: canvas should scale to fit mobile and desktop while maintaining aspect ratio (e.g., virtual internal resolution 288x512 scaled to fit).
    • Show current score during play and display high score after game over.
  3. Code quality:

    • Use clear, commented code with small functions and an IIFE or module pattern to avoid globals.
    • No external libraries required.
    • Include an SPDX license header at the top of each source file and add a LICENSE file (MIT).
  4. Pull request details:

    • PR branch: feature/flappy-bird-web
    • Base branch: leave as default branch (do not specify if unknown)
    • PR title: "Add Flappy Bird web clone"
    • PR description: include a short summary of features, files added, usage instructions, and testing notes.

Notes for the implementer (developer):

  • Keep the implementation simple and self-contained so reviewers can play the game by opening index.html in the browser.
  • Prefer using canvas 2D API and built-in browser features to avoid bundlers.
  • If any assets (images or audio) are added, keep them small and place them under assets/.

Do not assign an assignee. Do not reference any images (none were uploaded).


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: pallaviraiturkar0 <191165691+pallaviraiturkar0@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement Flappy Bird web clone playable in browser Add Flappy Bird web clone Dec 1, 2025
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.

2 participants