A classic 2D tank battle game inspired by 1980s console games like Battle City, built with Phaser.js.
- Open
index.htmlin a web browser - Press ENTER to start the game
- Use Arrow Keys to move your tank (green)
- Press SPACEBAR to fire projectiles
- Destroy all enemy tanks (red) while protecting your base (blue)
- Avoid enemy fire and protect your base at all costs!
- ✅ Player tank movement with arrow keys
- ✅ Projectile shooting with spacebar
- ✅ Enemy tanks with basic AI
- ✅ Destructible brick walls (brown)
- ✅ Indestructible steel walls (gray)
- ✅ Base protection mechanics
- ✅ Lives system (3 lives)
- ✅ Score tracking
- ✅ Level progression
- ✅ Collision detection
- ✅ Game over and restart functionality
- Tank Movement: Grid-aligned movement in 4 directions
- Combat: Single projectile per tank with cooldown
- Walls: Brick walls can be destroyed, steel walls deflect bullets
- Enemy AI: Random movement with periodic shooting
- Scoring:
- Destroy enemy tank: +100 points
- Destroy brick wall: +10 points
- Complete level: +500 points
- Framework: Phaser.js 3.70.0
- Resolution: 800x600 pixels
- Tile Size: 32x32 pixels
- Performance: Targets 60 FPS
- Browser Support: Modern browsers with HTML5 Canvas support
Tank sprites with realistic details including barrels, tracks, and turrets:
- 🟢 Player Tank (Green with directional barrel)
- 🔴 Enemy Tanks (Red with directional barrel)
- 🟫 Brick Walls (Brown, destructible)
- ⬜ Steel Walls (Gray, indestructible)
- 🔵 Base (Blue, must protect)
- 🟢 Player Projectiles (Green, 12x12 pixels)
- 🟡 Enemy Projectiles (Yellow, 8x8 pixels)
- Clone or download the files
- Open
index.htmlin any modern web browser - No additional installation required!
tank-game/
├── index.html # Main HTML file with game container
├── game.js # Core game logic and Phaser implementation
├── PRD.md # Product Requirements Document
└── README.md # This file
- Use walls strategically - Hide behind brick walls and create paths
- Protect your base - Keep enemies away from the blue base at the bottom
- Plan your shots - You can only fire one bullet at a time
- Watch enemy patterns - Enemies move randomly but shoot periodically
- Clear paths - Destroy brick walls to create better firing lanes
Based on the PRD, potential future additions include:
- Power-ups (rapid fire, armor, speed boost)
- Different enemy tank types
- Multiple level designs
- Sound effects and music
- Improved graphics and animations
- Mobile touch controls
- Better AI pathfinding
- None currently identified - report any bugs you find!
This is a demonstration project. Feel free to use and modify as needed.
Have fun playing! 🎮