๐ฎ BulletBuzz { width="150" }
A browser-based bullet heaven game inspired by Brotato and Vampire Survivors, featuring auto-pathing, combat mechanics, and headless simulation capabilities for balance testing.
๐ Play Now Play BulletBuzz on GitHub Pages
๐ฎ Development Mode : Add ?speed=10
to the URL for 10x game speed for faster testing!
๐ฏ Game Features ๐ง Advanced AI
Auto-Pathing : Intelligent movement with wall avoidance and target tracking
Combat AI : Smart targeting within attack range with automatic axe throwing
Pickup Attraction : XP orbs and hearts attract to player within pickup range
Robot Vacuum Mode : Efficient pickup collection with pathfinding to drops
โ๏ธ Gameplay Mechanics
Bullet Heaven : Survive waves of enemies in an endless arena
XP System : Level up to unlock new abilities with accurate progress tracking
Pickup System : Collect hearts and XP drops with attraction mechanics
Shop System : Choose upgrades between levels with auto-shop option
Difficulty Scaling : Progressive challenge increase with dynamic spawn rates
๐จ Enhanced UI
Professional Shop Modal : Button-like options with sequential numbering
Detailed Game Over Screen : Comprehensive statistics with skull emoji
Real-time Stats : Live player and enemy statistics
Range Visualization : Attack and pickup range circles
XP Progress Bar : Visual progress tracking
๐ ๏ธ Development Features
Headless Simulation : Automated balance testing
Real-time Debugging : Browser console tools
Parameter Adjustment : Live game balance controls
Performance Monitoring : Memory and performance tracking
URL Parameters : Game speed control via URL
Automated Screenshots : Playwright-based screenshot testing
๐๏ธ Architecture ๐ Project Structure bulletbuzz / โโโ src / โ โโโ BulletBuzzGame . ts # Game API facade โ โโโ game - ui . ts # UI rendering and controls โ โโโ types . ts # TypeScript interfaces โ โโโ core / โ โ โโโ Game . ts # Core game loop and state โ โ โโโ Player . ts # Player AI and movement โ โ โโโ Enemy . ts # Enemy behavior โ โ โโโ Axe . ts # Projectile mechanics โ โ โโโ XpDrop . ts # XP pickup with attraction โ โ โโโ HeartDrop . ts # Health pickup with attraction โ โโโ systems / โ โโโ SpawnSystem . ts # Enemy and pickup spawning โ โโโ CollisionSystem . ts # Collision detection โ โโโ LevelSystem . ts # Level progression and shop โโโ dist / # Compiled JavaScript โโโ tests / # Unit tests โโโ scripts / # Utility scripts โ โโโ screenshots . js # Screenshot automation โโโ . tmp / # Temporary files ( screenshots ) โโโ index . html # Game interface โโโ test - runner . js # Headless simulation โโโ screenshot - test . js # Basic screenshot testing โโโ advanced - screenshots . js # Advanced screenshot class โโโ package . json # Dependencies & scripts
Copy
๐ง Technology Stack
TypeScript : Type-safe game development
HTML5 Canvas : Game rendering
ES Modules : Modern JavaScript modules
Node.js : Headless testing environment
Jest : Unit testing framework
Playwright : Automated browser testing and screenshots
๐ Quick Start Local Development # Clone the repository git clone https://github.com/tjsingleton/bulletbuzz.git cd bulletbuzz # Install dependencies npm install # Start development server npm run dev # Build for production npm run build # Run tests npm test
Copy
Game Speed Control
Development : http://localhost:XXXX/?speed=10
for 10x speed
Production : https://tjsingleton.github.io/bulletbuzz/
(1x speed)
Custom : ?speed=X
where X is any positive number
Testing # Run headless simulation node test-runner.js # Test different configurations node test-runner.js --test-configs # Browser console debugging # Open browser console and use: debugGame.logState()
Copy
Screenshot Testing # Basic screenshot test npm run screenshots # Advanced screenshot testing npm run screenshots:advanced # UI element screenshots npm run screenshots:ui # Speed test screenshots npm run screenshots:speed # Game state screenshots npm run screenshots:game-states # Game over screenshots npm run screenshots:game-over # All screenshot tests npm run screenshots:all # Clean up screenshots npm run screenshots:clean # Show available commands npm run screenshots:help
Copy
๐ฎ Controls Game Controls
WASD/Arrow Keys : Manual movement (optional)
P : Pause/Unpause
R : Reset game
1-5 : Shop selection (when shop is open)
Auto-Features
Auto-Pathing : Checkbox to enable/disable AI movement
Auto-Shop : Checkbox to automatically select shop upgrades
Game Speed : Slider to adjust game speed (0.1x to 20x)
Debug Commands (Browser Console) debugGame . logState () // Log current game state debugGame . getMemory () // Check memory usage debugGame . logPerformance () // Performance metrics debugGame . reset () // Reset game debugGame . pause () // Toggle pause debugGame . spawnEnemy () // Force spawn enemy
Copy
๐งช Testing & Balance Automated Testing
Unit Tests : 28 comprehensive tests covering all systems
Headless Simulation : Run thousands of games automatically
Balance Testing : Test different parameter configurations
Performance Monitoring : Track memory usage and performance
Regression Testing : Ensure changes don't break existing functionality
Screenshot Testing : Automated visual testing with Playwright
Parameter Adjustment Real-time adjustment of game balance via browser sliders:
Player stats (HP, speed, pickup range, attack range)
Enemy behavior (speed, spawn rate)
Auto-pathing settings (avoidance, flee mechanics)
Difficulty scaling (level progression)
๐ Game Balance Current Settings
Player : 10 HP, 0.85 speed, 25 pickup range, 150 attack range
Enemies : 0.15 speed, 8s spawn interval
Auto-Pathing : 120 avoidance distance, 2.0 strength
Difficulty : Single enemy until level 6, 15% scaling
Shop : Appears after every level with 3 random options
Balance Metrics
Success Rate : % of runs reaching target level
Average Time : Time to reach target level
Survival Rate : % of runs where player survives
Performance : Memory usage and frame rates
๐ง Development Building # TypeScript compilation npm run build # Watch mode for development npm run dev:watch # Type checking only npm run type-check
Copy
Testing # Run all tests npm test # Quick balance test node test-runner.js --quick # Configuration testing node test-runner.js --test-configs # Custom simulation node test-runner.js --runs 10 --target 5 --time 300
Copy
Screenshot Development # Take screenshots during development npm run screenshots:ui # Test different game states npm run screenshots:game-states # Verify UI changes npm run screenshots:all # Clean up after testing npm run screenshots:clean
Copy
Optimizations
Fixed Timestep : Consistent game updates regardless of frame rate
Object Pooling : Efficient memory management
Lifetime Tracking : Automatic cleanup of temporary objects
Array Limits : Prevent unbounded growth
Modular Architecture : Clean separation of concerns
Monitoring
Memory Usage : Automatic warnings at 90% capacity
Performance Metrics : Frame rate and update timing
Debug Tools : Real-time state inspection
๐จ UI Features Shop System
Professional Modal : Dark theme with button-like options
Sequential Numbering : Options always numbered 1, 2, 3
Auto-Shop : Automatic selection with checkbox control
Visual Feedback : Clear instructions and hover effects
Game Over Screen
Detailed Statistics : Survival time, level reached, enemies killed
Performance Metrics : Kill rate, XP efficiency
Visual Design : Skull emoji and color-coded information
Professional Layout : Modal with proper alignment
Real-time UI
Live Stats : Player and enemy statistics
Range Visualization : Attack and pickup range circles
XP Progress : Visual progress bar with current/required
Game Controls : Speed slider, auto-pathing, auto-shop
๐ธ Screenshot Testing Automated Visual Testing
Playwright Integration : Cross-browser screenshot testing
Game State Capture : Screenshots at different game stages
UI Element Testing : Pause, resume, auto-pathing states
Speed Testing : Screenshots at different game speeds
Shop Testing : Shop modal and auto-shop functionality
Game Over Testing : Detailed statistics and modal screenshots
Screenshot Features
Temporary Storage : Screenshots stored in .tmp/screenshots/
Automatic Cleanup : Old screenshots removed before new tests
Live-Server Ignored : Screenshots don't trigger development reloads
Git Ignored : Temporary files not tracked in version control
Timestamped Files : Organized screenshots with timestamps
Full Page Capture : Complete game interface screenshots
Screenshot Commands # Basic screenshot test npm run screenshots # Advanced screenshot testing npm run screenshots:advanced # UI element screenshots npm run screenshots:ui # Speed test screenshots npm run screenshots:speed # Game state screenshots npm run screenshots:game-states # Game over screenshots npm run screenshots:game-over # All screenshot tests npm run screenshots:all # Clean up screenshots npm run screenshots:clean # Show available commands npm run screenshots:help
Copy
๐ค Contributing
Fork the repository
Create a feature branch (git checkout -b feature/amazing-feature
)
Commit your changes (git commit -m 'Add amazing feature'
)
Push to the branch (git push origin feature/amazing-feature
)
Open a Pull Request
๐ License This project is licensed under the ISC License - see the LICENSE file for details.
๐ฏ Roadmap
[x] Modular Architecture : Clean separation of game systems
[x] Enhanced UI : Professional shop and game over screens
[x] Auto-Shop : Automatic upgrade selection
[x] Pickup Attraction : XP and heart attraction mechanics
[x] URL Parameters : Game speed control via URL
[x] Screenshot Testing : Automated visual testing with Playwright
[ ] Multiplayer Support : Real-time multiplayer battles
[ ] More Enemy Types : Different enemy behaviors and abilities
[ ] Power-ups : Temporary buffs and special abilities
[ ] Achievements : Unlockable achievements and stats
[ ] Mobile Support : Touch controls and mobile optimization
[ ] Sound Effects : Audio feedback and music
[ ] Particle Effects : Visual enhancements and feedback
๐ Known Issues
Performance : High enemy counts may impact frame rate
Balance : Early game may be too easy for experienced players
Mobile : Touch controls not yet implemented
๐ Support
Made with โค๏ธ by @tjsingleton