This is a simple, browser-based space shooter game where the player controls a spaceship, shoots at incoming asteroids, and tries to achieve a high score while managing health.
- Player Control: Move the spaceship horizontally using the mouse or touch.
- Shooting: Fire bullets by clicking the mouse or tapping the screen.
- Enemies: Asteroids (enemies) appear from the top and move downwards.
- Collision Detection: Bullets destroy enemies, and enemies reduce player health upon collision or when they pass the player.
- Score System: Earn points for destroying enemies.
- Health Bar: Visual representation of the player's health.
- Game Over Screen: Displays the final score and a restart option when health reaches zero or the player collides with an enemy.
- Sound Effects: Includes shooting and explosion sounds, and background music.
- Responsive Design: Adapts to different screen sizes.
- HTML5: For the game structure and elements.
- CSS3: For styling the game elements and layout.
- JavaScript: For game logic, interactions, and animations.
- Open
index.htmlin your web browser. - Move your mouse (or finger on touch devices) horizontally to control the spaceship.
- Click the mouse (or tap the screen) to fire bullets.
- Destroy as many asteroids as possible to increase your score.
- Avoid letting asteroids hit your spaceship or pass the bottom of the screen, as this will reduce your health.
- If your health reaches zero, the game is over. Click "Restart" to play again.
./
├── index.html # Main HTML file for the game interface
├── styles.css # CSS file for styling the game elements
├── script.js # JavaScript file containing the game logic
└── README.md # This README file
- Background Image: https://opengameart.org/sites/default/files/bg5.jpg.preview.jpg
- Spaceship Image: https://opengameart.org/sites/default/files/ship_0.png
- Asteroid Image: https://opengameart.org/sites/default/files/asteroid_1.png
- Shoot Sound: https://opengameart.org/sites/default/files/laser5.wav
- Explosion Sound: https://opengameart.org/sites/default/files/explosion_1.wav
- Background Music: https://s3-us-west-2.amazonaws.com/s.cdpn.io/455279/sstar.mp3
Shikhar
This project is open-source and available under the ISC License.