A classic Space Invaders game built through prompting with Claude 3.5 Sonnet. The game features retro-style graphics, sound effects, and progressive difficulty.
This game was developed through a series of prompts with Claude. Here'''s the key development steps:
-
Core Game Development
- Created base Entity class for game objects
- Implemented player movement and shooting
- Added enemy formation and movement patterns
- Created collision detection system
-
Sound System Evolution
- Started with basic alien movement sound
- Refined to 55Hz base frequency
- Added 4-semitone descending pattern
- Implemented noise-based shooting sounds
- Created modulated UFO sound
- Added explosion sound effects
-
Game Mechanics Enhancement
- Added diving aliens with 1->2->3 cycling pattern
- Implemented level progression
- Created destructible barriers
- Added UFO bonus enemy
- Implemented starfield background
- Added initial delay before enemies shoot
-
Build System Development
- Started with multiple script files
- Created Node.js build script
- Added minification
- Implemented basic code obfuscation
- Created single self-contained HTML output
- Clone the repository
- Install dependencies:
npm install
- Build the game:
npm run build
- Open
dist/spaceinvaders.html
in a browser
.
├── index.html # Main game HTML
├── js/
│ ├── Entity.js # Base class for game objects
│ ├── Player.js # Player ship implementation
│ ├── Enemy.js # Enemy aliens implementation
│ ├── Barrier.js # Destructible barriers
│ ├── Bullet.js # Projectile handling
│ ├── StarField.js # Background star animation
│ ├── UFO.js # Bonus UFO enemy
│ ├── SoundEngine.js # Web Audio implementation
│ ├── GameEngine.js # Main game logic
│ └── main.js # Entry point
├── build.js # Build script
└── package.json # Project configuration
- Classic Space Invaders gameplay
- Progressive difficulty with each wave
- Destructible barriers that reset each wave
- Diving aliens with cycling patterns (1->2->3->1)
- UFO bonus enemy with unique sound
- Score tracking system
- Game over and restart functionality
The game uses Web Audio API for all sound effects:
- Alien movement: 55Hz base frequency with 4-semitone descent pattern
- Shooting: Noise-based effects with frequency sweeps
- UFO: Modulated oscillators for distinctive sound
- Explosions: Noise burst effects
- Animated starfield background
- Enemy formation movement
- Diving alien patterns
- Destructible barrier visualization
- UFO bonus enemy animation
The project uses a custom build script that:
- Combines all JavaScript files
- Minifies code and HTML
- Applies basic code obfuscation
- Creates a single, self-contained HTML file
- Left/Right Arrow Keys: Move player
- Spacebar: Shoot
- Enter: Restart game (after game over)
For development:
- Edit source files in
js/
directory - Open
index.html
directly in browser for testing - Use build script for distribution:
npm run build
- Developed through prompting with Anthropic'''s Claude 3.5 Sonnet
- Inspired by the classic Space Invaders arcade game
- Built using vanilla JavaScript and Web Audio API
MIT License