Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

๐Ÿฅ Flappy Bird (Vanilla JavaScript)

A responsive, lightweight Flappy Bird clone built with HTML5 Canvas, CSS3, and modern Vanilla JavaScript. Features dynamic physics, touch/keyboard controls, local high-score persistence, and modal UI overlays.


๐Ÿ“ธ Preview

(Add a screenshot of your game here once hosted, e.g., ![Flappy Bird Preview](./preview.png))


โœจ Features

* 60 FPS Canvas Rendering: Built using requestAnimationFrame for smooth animations.

* Cross-Platform Controls: Supports Keyboard (Space, Arrow Up, X), Mouse Click, and Mobile Touch interactions.

* Persistent High Scores: Saves your top score using browser localStorage.

* Dynamic Pipe Generation: Randomized pipe gaps and heights generated on set intervals.

* AABB Collision System: Accurate Axis-Aligned Bounding Box collision detection for game over states.


๐Ÿ› ๏ธ Tech Stack

* Markup: HTML5 Canvas & Overlay UI

* Styling: CSS3 (Flexbox, Modal Overlays)

* Scripting: Modern Vanilla JavaScript (ES6+)


๐Ÿ“ Project Structure

```text

โ”œโ”€โ”€ index.html # Core markup and canvas element

โ”œโ”€โ”€ style.css # Layout, fonts, and UI modal styling

โ”œโ”€โ”€ script.js # Main game loop, state handling, and physics logic

โ”œโ”€โ”€ flappybird3.png # Player sprite

โ”œโ”€โ”€ toppipe.png # Top obstacle sprite

โ””โ”€โ”€ bottompipe.png # Bottom obstacle sprite

```


๐Ÿš€ Getting Started

### Prerequisites

All you need is a modern web browser (Chrome, Firefox, Edge, or Safari).

### Local Setup

1. Clone the repository:

```bash

```

2. Navigate into the directory:

```bash

cd flappy-bird-js

```

3. Run the project:

* Open index.html directly in your browser, or

* Use the Live Server extension in VS Code for local hosting.


๐ŸŽฎ How to Play

* Start Game / Jump: Press Space, Arrow Up, Key X, or tap/click the screen.

* Objective: Pass through the gaps between vertical pipes without crashing into them or hitting the floor.

* Restart: Click the Restart button on the Game Over screen to try again.


๐Ÿ“„ License

Distributed under the MIT License. See LICENSE for more information.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages