Created by JetBrains Junie
Create a single player tank battle game using Javascript/Html/Css and 2d canvas
The game has the following features
Top down 2d
Single Player
Different terrains - desert , cactus, water
Two different ammo types - armor piercing and high explosive
Use Particle effects for bullets
Graphic style is 8 bit graphics
The tank has to avoid being destroyed by automated turrets that will target the tank if within a diameter
A top-down 2D single-player tank battle game with retro 8-bit graphics.
Tank Battle is an action-packed tank combat game where you control a tank and battle against enemy turrets and tanks. Navigate through a terrain of desert, cactus, and water while collecting ammo power-ups and destroying enemy targets.
- Top-down 2D gameplay with retro 8-bit graphics
- 5 progressively challenging levels
- Different terrain types (desert, cactus, water)
- Two ammo types: Armor Piercing (AP) and High Explosive (HE)
- Wave-based enemy tank system
- Fixed position enemy turrets
- Particle effects for bullets and explosions
- Power-up system for ammo replenishment
- Scrolling camera to navigate a large game world
- Sound effects for different weapons and actions
- W, A, S, D: Move the tank
- Mouse: Aim the tank's turret
- Left Click: Fire Armor Piercing (AP) ammo
- Right Click: Fire High Explosive (HE) ammo
Your mission is to destroy all enemy turrets in each level to progress. The game consists of 5 levels, with each level increasing in difficulty.
- Stationary Turrets: These are fixed position turrets that will target and fire at your tank if you come within their detection radius. Each level increases their size, range, and damage by 10%.
- Enemy Tanks: These appear in waves (starting with one, then two, then three) and move across the map. They will target and fire at your tank if you're within range.
- Armor Piercing (AP): Standard ammo with slightly longer range but less damage, effective against all targets.
- High Explosive (HE): Special ammo with 30% more damage but 30% less range, creating more particles on impact.
Ammo power-ups will spawn when your ammo levels reach half capacity:
- AP Power-up: Replenishes 5 Armor Piercing ammo
- HE Power-up: Replenishes 3 High Explosive ammo
- Desert: Basic terrain, fully traversable
- Cactus: Decorative terrain on desert, fully traversable
- Water: Obstacle terrain, cannot be traversed
The game is built using:
- HTML5 Canvas for rendering
- JavaScript for game logic
- CSS for styling
The game features:
- Collision detection system
- Particle system for visual effects
- Wave-based enemy spawning
- Level progression system
- Camera/viewport system for a larger game world
- Clone the repository:
git clone https://github.com/yourusername/tank-game.git
- Navigate to the project directory:
cd tank-game
- Open
index.htmlin your web browser to play the game.
No additional dependencies or build steps are required.
The game's code is organized as follows:
index.html: Main HTML filestyles.css: CSS stylingindex.js: Game logic and renderingassets/: Directory containing sound effects
- Game Design & Development: [Your Name]
- Sound Effects:
- tank-shot.wav
- tank-shot-he.wav
- turret-shot.wav
- explosion.wav
This project is licensed under the MIT License - see the LICENSE file for details.