Space Invaders by Andrea Maille is a pure vanilla JavaScript version of the famous 2D game from 1978.
The game has the following features:
- Collision detection
- Shooting with spacebar
- Left & Right (x-axis) movement with keyboard arrows
- Peace Mode (shoot enemies with roses instead of rockets 😂)
- Timer
- Score count
- Highscore board
- Submit your score
While the game doesn’t offer much resistance in terms of the enemy A.I and lacks sound effects (which would instantly make it more addicting), it’s a great source of learning and inspiration for anyone who wants to build games with pure vanilla JavaScript.
Check out the source code.