JavaScript/HTML5 Canvas space shooter, based on the Kodeco (Ray Wenderlich) Cocos2d-x tutorial, rebuilt as a browser game.
Tutorial source: https://www.kodeco.com/2728-cocos2d-x-tutorial-for-ios-and-android-space-game
- Player ship movement (keyboard)
- Laser shooting with object pooling
- Asteroid spawning with pooling
- Laser ↔ asteroid collision detection
- Ship hit detection, lives, and invulnerability blink
- Win/Lose game states and restart
- Parallax scrolling backgrounds
- Particle starfield
- Background music + sound effects
- Debug toggles for tuning
- Top menu + dark/light theme toggle
- Move:
ASDWor↑ ↓ ← → - Fire:
Space - Restart:
RorEnter - Toggle Audio:
M - Debug:
P - Parallax seam debug:
O - World speed:
K/L
- Vanilla JavaScript (ES Modules)
- HTML5 Canvas
- CSS
- Audio via HTMLAudioElement
- Texture atlas + plist parsing
npm install
npm startThen open: http://127.0.0.1:5500/
- Open project in VS Code
- Run Live Server on
index.html - Open in browser
python -m http.server 5500Then open: http://127.0.0.1:5500/
assets/
audio/
music/
sfx/
images/
particles/
src/
audio/
entities/
fx/
gfx/
game.js
input.js
index.html
package.json
- Background music uses
assets/audio/music/SpaceGame.oggwith MP3 fallback. - Sound effects are loaded from
assets/audio/sfx/.
- Explosion particle effects on asteroid hit
- Enemy ships + enemy lasers
- Score system + high score persistence
- Power-ups
- Mobile/touch controls
- Settings panel (audio volume, difficulty)
- Original tutorial/game design inspiration: Kodeco / Ray Wenderlich Cocos2d-x Space Game tutorial
- Original C++ versions from Platform Game Development work
