A full-featured roguelite twin-stick shooter built with Phaser 3 and JavaScript, playable directly in the browser.
- Twin-stick controls: WASD for movement, mouse for aiming and shooting
- 7 unique weapons: Pistol, SMG, Shotgun, Sniper Rifle, Laser Rifle, Rocket Launcher, Lightning Gun
- 6+ enemy types: Chasers, Shooters, Tanks, Splitters, Teleporters, Spawners
- Boss encounters: Phase-based bosses with unique attack patterns
- Procedural generation: Randomly generated rooms with obstacles and hazards
- Run-based upgrades: Choose from 3 upgrades after clearing each room
- Meta-progression: Earn currency to unlock permanent upgrades between runs
- Multiple biomes: Facility, Caves, Factory, and Void with unique aesthetics and enemy pools
- Difficulty scaling: Enemies get tougher as you progress through rooms
- Pistol - Balanced starter weapon with infinite ammo
- SMG - Rapid fire with spray pattern
- Shotgun - Close-range devastation with multi-pellet spread
- Sniper Rifle - High damage, piercing shots
- Laser Rifle - Continuous piercing beam
- Rocket Launcher - Explosive area-of-effect damage
- Lightning Gun - Chains damage between enemies
Keyboard & Mouse:
- WASD: Movement
- Mouse: Aim and shoot
- 1-7: Switch weapons
- Space: Dash (with cooldown)
Gamepad (if connected):
- Left stick: Movement
- Right stick: Aim and shoot
- L1/R1: Switch weapons
- A button: Dash
- Max Health increase
- Damage boost
- Fire rate increase
- Movement speed boost
- Projectile speed boost
- Piercing shots
- Extra projectiles
- Life steal
- Critical hit chance
- Dash cooldown reduction
- Install dependencies:
npm install
- Run development server:
npm run dev
- Build for production:
npm run build
- Object pooling for projectiles and particles
- Spatial partitioning for efficient collision detection
- Camera culling to only render visible objects
- Texture atlases for efficient sprite rendering
- Optimized physics with Phaser's Arcade Physics
Works on all modern browsers that support:
- HTML5 Canvas
- ES6 Modules
- WebGL (fallback to Canvas2D)
Optimized for desktop and capable devices. Mobile/touch support included via virtual joysticks.
first-javascript-game/
├── index.html # Entry point
├── package.json # Dependencies
├── vite.config.js # Build configuration
├── src/
│ ├── main.js # Phaser game initialization
│ ├── config.js # Game configuration and constants
│ ├── scenes/ # Game scenes
│ │ ├── BootScene.js
│ │ ├── MenuScene.js
│ │ ├── GameScene.js
│ │ ├── UIScene.js
│ │ ├── UpgradeScene.js
│ │ └── GameOverScene.js
│ ├── entities/ # Game entities
│ │ ├── Player.js
│ │ ├── Enemy.js
│ │ ├── Boss.js
│ │ ├── Weapon.js
│ │ └── Pickup.js
│ ├── weapons/ # Weapon implementations
│ │ ├── Pistol.js
│ │ ├── SMG.js
│ │ ├── Shotgun.js
│ │ ├── Sniper.js
│ │ ├── Laser.js
│ │ ├── Rocket.js
│ │ └── Lightning.js
│ └── managers/ # Game systems
│ ├── LevelManager.js
│ ├── EnemyManager.js
│ ├── UpgradeManager.js
│ ├── ProgressionManager.js
│ └── PoolManager.js
The game features procedurally generated pixel art sprites:
- Unique pixel art designs for player and all enemy types
- Distinct visual styles for each weapon and projectile
- Animated particle effects
- Hand-crafted pickup icons (health hearts and ammo boxes)
All graphics are generated programmatically using the Canvas API, ensuring consistent style and easy modifications.
- Phaser 3: Game framework
- Vite: Build tool and dev server
- JavaScript ES6+: Modern JavaScript features
- HTML5 Canvas: Rendering and pixel art generation
- LocalStorage: Save data persistence
This roguelite twin-stick shooter emphasizes:
- Fast-paced action gameplay
- Strategic weapon selection and switching
- Risk/reward decision making in upgrade choices
- Replayability through procedural generation and meta-progression
- Satisfying combat with visual and audio feedback
Potential additions:
- Pixel art sprite replacements for placeholder graphics
- Sound effects and music
- Additional biomes and bosses
- More enemy types and variants
- Expanded meta-progression system
- Achievement system
- Leaderboards
- Additional special abilities
- Co-op multiplayer
This project is open source and available for educational purposes.