A modern remake of the classic Asteroids arcade game built using
Vanilla JavaScript + HTML5 Canvas โ no frameworks, no build tools.
This project focuses on clean game architecture, physics, collision detection, and classic arcade gameplay mechanics, all running directly in the browser.
- Ship rotation, thrust, hyperspace & shooting
- Toroidal (wrap-around) world with accurate collision detection
- Asteroids that split into smaller, faster pieces
- UFO enemies with adaptive AI and return fire
- Particle effects (explosions & thrusters)
- Multiple lives, progressive levels, and difficulty scaling
- Persistent high score using
localStorage - Keyboard + pointer (mouse/touch) support
- Fully playable by opening a single HTML file
- โ / โ or A / D โ Rotate ship
- โ or W โ Thrust
- Space โ Fire
- Shift โ Hyperspace jump
- P โ Pause / Resume
- Enter โ Start / Restart
- HTML5 Canvas
- Vanilla JavaScript (ES6)
- Tailwind CSS (CDN, UI only)
No frameworks. No build process. Just clean browser-native code.
Smarty Saini
๐ Links
- GitHub: https://github.com/smarty-saini
- LinkedIn: https://www.linkedin.com/in/smartysaini/
- Medium: https://medium.com/@contact_26633
- Gumroad: https://smartysaini.gumroad.com/
- TryHackMe: https://tryhackme.com/p/SmaRTySaini
Simply open index.html in any modern browser.
git clone https://github.com/smarty-saini/asteroids-canvas.git
cd asteroids-canvas
open index.html