A classic Space Invaders game built with HTML5 Canvas and Node.js.
- Progressive Difficulty: Levels get progressively harder with more enemies and faster gameplay
- Pause Functionality: Press P or click the Pause button to pause and resume the game
- Score Tracking: Earn points for each enemy destroyed (points increase per level)
- Lives System: Start with 3 lives, lose a life when hit by enemy fire
- Visual Effects: Explosions and particles on enemy destruction
- Responsive Design: Works on desktop browsers
- High Performance: Optimized canvas rendering with smooth 60 FPS gameplay
- Node.js 22.x LTS (Latest)
- npm
- Navigate to the project directory:
cd "Space Invaders"- Install dependencies:
npm installStart the server:
npm startThen open your browser and visit:
http://localhost:3000
- Arrow Keys: Move left and right
- Spacebar: Shoot
- P Key: Pause/Resume
- Pause Button: Pause/Resume (UI button)
- Restart Button: Start a new game
- Each level spawns more enemies than the previous one
- Enemy speed increases per level
- Enemy fire rate increases per level
- Clear all enemies to advance to the next level
- Base points: 10 points per enemy destroyed
- Points increase with level multiplier (Level 1 = 10pts, Level 2 = 20pts, etc.)
- Lose all 3 lives
- Enemies reach the bottom of the screen
Space Invaders/
├── server.js # Express server
├── package.json # Project dependencies
├── public/
│ ├── index.html # Game HTML
│ ├── game.js # Game logic
│ └── styles.css # Game styling
└── README.md # This file
Works best in modern browsers with HTML5 Canvas support:
- Chrome
- Firefox
- Safari
- Edge
MIT