A browser-based game that combines the mechanics of Flappy Bird and Space Invaders with a nocturnal, starry-night theme. The player controls a "bird" that must navigate through a barrage of oncoming "invaders."
This project is a simple, single-file HTML game that uses the HTML5 Canvas API and vanilla JavaScript. The player's objective is to survive as long as possible by avoiding randomly generated invaders. In a twist on the classic Flappy Bird formula, the player can also shoot a laser to destroy the invaders and earn extra points. The game features a dynamic starry background, sound effects for in-game actions, and a toggleable background soundtrack.
- Start the game: The game will begin with a countdown from 3.
- Flap: Press the
Spacebar to make the bird jump upwards. - Shoot:
Clickthe left mouse button to fire a laser from the bird. - Restart: After a game over, press the
Spacebar to start a new game. - Toggle Soundtrack: Click the "Soundtrack" button to turn the background music on or off.
Objective: Avoid colliding with the invaders and the top and bottom edges of the screen. Score points by successfully passing invaders or by destroying them with your laser.
- Hybrid Gameplay: Combines the gravity-based movement of Flappy Bird with the shooting mechanics of Space Invaders.
- Dynamic Background: A procedurally generated starry night sky.
- Sound Effects: Audio feedback for jumping, shooting, and collisions.
- Background Music: An optional looping soundtrack to enhance the gaming experience.
- Scoring System: Players earn points for both avoiding and destroying invaders.
To run the game, you do not need any special setup or dependencies.
- Save the provided HTML code as an
.htmlfile (e.g.,index.html). - Open the file in any modern web browser.
That's it! The game will start automatically.