You control a spaceship at the bottom of the screen and must shoot down waves of invading aliens before they reach you or the ground.
The game runs completely in the browser using:
- HTML5 for the game layout
- CSS3 for visuals
- Vanilla JavaScript for game logic, collision detection and input handling
This project is great as an example of building a small game with pure JS, using only the DOM.
- Player spaceship that can move left and right
- Shoot projectiles to destroy enemies
- Multiple alien invaders moving across and down the screen
- Lives or limited attempts
- Score tracking
- Game over and restart
Note: You can customize all of these in the source code (speed, number of enemies, etc.).
Default controls:
- A / D keys – Move the ship left and right
- Spacebar – Shoot
- P - Pause the game
You can change the keys in the JavaScript file if you prefer different controls.
git clone https://github.com/scepeday/pixel_invaders.git
cd pixel_invaders