README
ยถ
โโโโโโโ โโโโโโโ โโโโโโโ โโโโ โโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโ
โโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โโโ
โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโ
โโโโโโโ โโโโโโโ โโโโโโโ โโโ โโโโโ
S P A C E D E F E N D E R โ โฒ โ
. * . โฒ . * . * .
* . / \ . * . * .
. * / O O \ . * โ . *
. /___________\ * . / \ .
* . | โ โ โ | . * |___| * .
. * |_______| . * . *
. * . โ * . โฒ . *
A retro arcade space shooter controlled by your head movements!
Play Now โข Features โข Controls โข Development
๐ About BOBN
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โฒ โ
โ /_\ INCOMING INVADERS! โ
โ | โ
โ โ โ โ โ โ โ โ โ โ โ โ
โ โ โ โ โ โ โ โ โ โ โ โ
โ โ โ โ โ โ โ โ โ โ โ โ
โ โ
โ โฒ โ
โ โโโโผโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
BOBN is a browser-based Space Invaders game written in Go and compiled to WebAssembly. What makes it special? You control your ship using head movements tracked by your webcam!
๐ฎ Key Features
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โโโโโ FEATURES โโโโโ โโโโโ โ
โ โ โฒ โ โ โ โ โ โ โ โ
โ โโโโโ โโโโโ โโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- ๐ฅ Camera-Based Control - Move your head left/right to control your ship
- ๐น๏ธ Classic Arcade Gameplay - Authentic Space Invaders experience
- ๐ Pure Browser-Based - No downloads or plugins required
- โก Go + WebAssembly - Fast, efficient performance
- ๐จ Retro CRT Effects - Scanlines, phosphor glow, and arcade aesthetics
- ๐ Live Head Tracking Display - ASCII art visualization of camera feed
- ๐ High Score Tracking - Compete for the top score
๐ฏ Quick Start
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ > INITIALIZING SYSTEM... โ
โ > LOADING WASM MODULE... โ
โ > READY PLAYER ONE โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Prerequisites
- Go 1.21 or higher
- Modern web browser with WebAssembly support
- Webcam (for head tracking control)
Installation & Running
# Clone the repository
git clone https://github.com/jonasrmichel/bobn.git
cd bobn
# Build and run
make run
# Open in browser
# Navigate to http://localhost:8080
๐ฎ How to Play
CONTROLS MOVEMENT
โโโโโโโโโโโโ โโโโโโโโโโโ
โ [SPACE] โ โ โ โ โ
โ FIRE โ โ HEAD โ
โโโโโโโโโโโโ โโโโโโโโโโโ
โโโโโโโโโโโโ โโโโโโโโโโโ
โ [ENTER] โ โ [ESC] โ
โ START โ โ PAUSE โ
โโโโโโโโโโโโ โโโโโโโโโโโ
Game Modes
- Attract Mode - Press ENTER or click START to begin
- Playing - Destroy all invaders before they reach you
- Game Over - Your final score is displayed
Scoring
โโโโโโโโโโโโโโโโโโโโโโโโ
โ ENEMY POINT VALUES โ
โ โโโโโโโโโโโโโโโโโโโโโโโฃ
โ โ = 10 POINTS โ
โ โฒ = 20 POINTS โ
โ โ = 30 POINTS โ
โ โ = ??? MYSTERY โ
โโโโโโโโโโโโโโโโโโโโโโโโ
๐ ๏ธ Development
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ < CODE STRUCTURE > โ
โ / | \ โ
โ cmd internal web โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Project Structure
bobn/
โโโ cmd/
โ โโโ server/ # HTTP server
โ โโโ wasm/ # WASM entry point
โโโ internal/
โ โโโ game/ # Game engine & logic
โ โ โโโ engine.go # Core game loop
โ โ โโโ entities.go # Game objects
โ โ โโโ state.go # Game state management
โ โโโ wasm/ # WASM-specific code
โ โโโ bridge.go # JS interop
โ โโโ camera.go # Head tracking
โ โโโ renderer.go # Canvas rendering
โโโ web/
โ โโโ index.html # Game UI
โ โโโ arcade.css # Retro styling
โ โโโ wasm_exec.js # Go WASM support
โโโ Makefile # Build automation
Build Commands
# Build everything
make all
# Build WASM only
make wasm
# Build server only
make server
# Run development server
make run
# Clean build artifacts
make clean
Development Tips
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ก PRO TIPS: โ
โ โ
โ โข Use Chrome DevTools โ
โ โข Check console for logs โ
โ โข Test with good lighting โ
โ โข Adjust camera threshold โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐จ Customization
Adjusting Head Tracking Sensitivity
Edit internal/wasm/camera.go:
// Increase/decrease sensitivity
gameX := -((c.smoothedX - 0.5) * 4.0) // Change multiplier
// Adjust detection threshold
if brightness > 80 { // Lower = more sensitive
Modifying Game Difficulty
Edit internal/game/engine.go:
// Invader speed
baseInvaderSpeed: 1.0 // Increase for harder
// Invader drop distance
invaderDropDistance: 20.0 // Pixels per drop
๐ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ BROWSER โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ HTML/CSS UI โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ
โ โ WASM Game Engine โ โ
โ โ โโโโโโโโโโโโฌโโโโโโโโโโโโ โ โ
โ โ โ Camera โ Game โ โ โ
โ โ โ Tracking โ Logic โ โ โ
โ โ โโโโโโโโโโโโดโโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ
โ โ Canvas Rendering โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Key Components
- Game Engine: Fixed timestep loop at 20Hz
- Rendering: 60 FPS canvas updates
- Camera Processing: 30 FPS head tracking
- Input System: Keyboard and camera hybrid control
๐ฎ Game Features
WAVES ENEMIES
โโโโโโโ โโโโโโโโโโโ
โ 1 โ โโโโโโโ> โ โ โ โ โ โ
โ 2 โ โโโโโโโ> โ โ โ โ โ โ
โ 3 โ โโโโโโโ> โ โฒ โฒ โฒ โฒ โ
โ 4+ โ โโโโโโโ> โ โ โ โ โ โ
โโโโโโโ โโโโโโโโโโโ
- Progressive difficulty increase
- Wave-based gameplay
- UFO bonus targets
- Life system
- Score tracking
๐ Troubleshooting
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ COMMON ISSUES & FIXES โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
| Issue | Solution |
|---|---|
| Camera not working | Allow camera permissions in browser |
| Black game screen | Refresh page, check console for errors |
| Laggy controls | Ensure good lighting for camera |
| Ship not responding | Press ENTER to start game first |
๐ License
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Apache License 2.0 โ
โ Copyright 2025 โ
โ Jonas Michel โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.
You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
๐ค Contributing
โฒ
/_\ CONTRIBUTORS WELCOME!
[___]
| | Fork โ Code โ PR
|_|
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
๐ฏ Roadmap
[ ] Multiplayer support
[ ] Power-ups & bonuses
[ ] More enemy types
[ ] Sound effects
[ ] Mobile touch controls
[ ] Leaderboard system
๐พ Credits
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ CREATED BY โ
โ Jonas Michel โ
โ โ
โ INSPIRED BY โ
โ Space Invaders (1978) โ
โ By Tomohiro Nishikado โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
GAME OVER
โฒ โ โ โฒ โ โ โฒ โ โ โฒ โ โ
INSERT COIN TO CONTINUE
[ PRESS START ]
Made with โค๏ธ and Go
Click to show internal directories.
Click to hide internal directories.