Fast, smooth, and share-ready Space Invaders built with pure HTML, CSS, and JavaScript. The game uses a time-based loop for consistent motion, transform-based positioning for better performance, and a compact HUD to track your run.
- Smooth movement with a time-based
requestAnimationFrameloop - Transform-based rendering for fewer layout/reflow hits
- Pause menu with resume/restart
- HUD with score, timer, lives, and best score (saved locally)
- Starfield background with reduced-motion support
- Left/Right Arrow: Move
- Space: Shoot (hold to fire)
- P or Esc: Pause
Open index.html in your browser.
- ✅ Responsive layout
- ✅ Runs without external dependencies
- ✅ Runs offline
- ✅ Simple controls with clear instructions
- The faster you clear the grid, the higher your chance to keep a clean run.
- Try to keep shots focused to avoid cluttering the screen.
- The game loop uses time deltas to stay consistent across devices.
- Elements are positioned with
transform: translate3d(...)to keep rendering smooth. - Best score is stored in
localStorage.