This is a simple browser-based Flappy Bird game built using JavaScript, HTML, and CSS. The objective of the game is to control the bird by making it jump to avoid obstacles and score points.
Screen.Recording.2024-12-21.at.12.07.02.AM.mov
- Jump Mechanics: Control the bird's vertical movement using the keyboard or mouse.
- Dynamic Obstacles: Obstacles move across the screen and respawn after passing.
- Level System: The game increases in level as obstacles are cleared.
- Collision Detection: Precise collision mechanics to determine game-over scenarios.
- Restart Option: Restart the game by clicking or pressing the spacebar after a game over.
-
Start the Game:
- Press the
spacebar
,W
,ArrowUp
, or click anywhere on the screen to start.
- Press the
-
Control the Bird:
- Press the
spacebar
,W
,ArrowUp
, or click to make the bird jump. - Avoid hitting obstacles or the ground.
- Press the
-
Game Over:
- The game ends if the bird collides with an obstacle or hits the ground.
- Click or press the
spacebar
to restart.
- Keyboard:
Spacebar
,W
,ArrowUp
: Jump
- Mouse:
- Click anywhere on the screen to jump.
-
Gravity:
- Gravity continuously pulls the bird down.
- Jumping gives the bird an upward velocity to counteract gravity.
-
Obstacles:
- Obstacles move from right to left.
- New obstacles appear once the old ones vanish.
-
Level Progression:
- Clearing all obstacles increases the level.
- The current level is displayed at the top of the screen.
-
Collision Detection:
- If the bird touches an obstacle or the ground, the game ends.
- index.html: The main HTML file for the game.
- style.css: The primary stylesheet for the game.
- gameOver.css: The stylesheet for the game-over screen.
- script.js: The JavaScript file containing the game logic.
-
Clone the repository:
git clone https://github.com/govindup63/flappy-bird-game.git
-
Open the project directory:
cd flappy-bird-game
-
Open
index.html
in your preferred browser.
You can tweak the game mechanics by editing the following variables in script.js
:
birdVelocity
: Adjust the bird's jumping velocity.gravity
: Modify the rate at which the bird falls.obstacleSpeed
: Change the speed of moving obstacles.groundLevel
: Set the position of the ground.
- jQuery (included via CDN in
index.html
)
- Add background music and sound effects.
- Implement a scoring system.
- Enhance the UI with better graphics and animations.
- Introduce additional levels or challenges.
This project is licensed under the MIT License.
Enjoy playing the game! 😊