You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Death Circuit - 2D Combat Arena Game
A fast-paced top-down shooter game where you fight against intelligent AI enemies in a cyberpunk arena.
## Features
- **4 Weapon Types**: Pistol, SMG, Shotgun, and Rifle with unique characteristics
- **4 Enemy AI Types**: Rusher, Sniper, Dodger, and Flanker with distinct behaviors
- **Procedural Arena Generation**: Different map layouts each wave
- **Advanced AI**: Enemies exhibit intelligent behaviors like dodging, flanking, and tactical positioning
- **Particle Effects**: Visual effects for shooting, explosions, and impacts
- **Wave-based Survival**: Progressively difficult waves with increasing enemy count
- **Health Regeneration**: Automatic healing between waves
- **Statistics Tracking**: Track kills, damage, accuracy, and survival time
## Installation
### Requirements
- Python 3.8 or higher
- Pygame library
### Installation Steps
1. **Install Python 3.8+**
- Download from [python.org](https://www.python.org/downloads/)
- Make sure to add Python to your PATH during installation
2. **Install Pygame**
```bash
pip install pygame
```
3. **Download the Game**
- Download all the files in the `DeathCircuit/` directory
- Keep the file structure intact
4. **Run the Game**
```bash
python main.py
```
## Controls
### Movement
- **W/A/S/D**: Move in 8 directions
- **Mouse**: Aim your weapon
- **Left Click**: Fire weapon
### Weapons
- **1**: Pistol (balanced)
- **2**: SMG (high fire rate)
- **3**: Shotgun (spread damage)
- **4**: Rifle (high damage, long range)
### Other Controls
- **R**: Reload current weapon
- **ESC**: Pause game / Open menu
## Gameplay
### Objective
Survive as many waves as possible by eliminating all enemies in each wave.
### Wave System
- **Wave 1**: 3 Rusher enemies
- **Wave 2**: 5 enemies (Rushers and Snipers)
- **Wave 3**: 7 enemies (mixed types)
- **Wave 4+**: Increasing difficulty with more enemies
### Enemy Types
#### Rusher (Red)
- **Behavior**: Charges directly at player
- **Weapon**: SMG
- **Strategy**: Close-range combat, aggressive
#### Sniper (Orange)
- **Behavior**: Maintains distance, accurate shots
- **Weapon**: Rifle
- **Strategy**: Long-range engagement, retreats when approached
#### Dodger (Purple)
- **Behavior**: Strafes and dodges incoming bullets
- **Weapon**: Shotgun
- **Strategy**: Avoids damage while closing in
#### Flanker (Green)
- **Behavior**: Tries to attack from sides/back
- **Weapon**: Rifle
- **Strategy**: Uses cover and positioning for surprise attacks
### Combat Tips
1. **Use Cover**: Walls provide protection from enemy fire
2. **Weapon Switching**: Switch weapons based on engagement range
3. **Movement**: Keep moving to avoid enemy fire
4. **Wave Breaks**: Use the 5-second breaks between waves to heal
5. **Enemy Prioritization**: Target Snipers and Flankers first as they're more dangerous
### Scoring
- **Waves Survived**: Main score metric
- **Enemies Killed**: Track total kills
- **Accuracy**: Shots hit vs shots fired
- **Survival Time**: Time alive in each run
## Technical Details
### Performance
- Target: 60 FPS stable performance
- Optimized collision detection using spatial partitioning
- Efficient AI decision-making (updates at 10 FPS)
- Particle system with maximum particle count limits
### Architecture
- **Object-oriented design** with clear class responsibilities
- **Modular components** for easy maintenance and expansion
- **No external dependencies** beyond Pygame and Python standard library
- **Production-ready code** with error handling and edge cases
### Customization
Game parameters can be adjusted in `config.py`:
- Weapon stats (damage, fire rate, reload time)
- Enemy behaviors (speed, detection range, accuracy)
- Visual effects (particle counts, screen shake)
- Game balance (health, regeneration, wave progression)
## Troubleshooting
### Common Issues
1. **Game won't start**
- Ensure Python 3.8+ is installed
- Check Pygame is installed: `pip show pygame`
- Verify all files are in the same directory
2. **Low FPS**
- Close other applications
- Check if particle effects are causing lag (lower `PARTICLE_MAX_COUNT` in config.py)
- Reduce screen resolution if needed
3. **Controls not responding**
- Make sure the game window has focus
- Check that mouse is within the game window
- Verify keyboard layout matches the game controls
### Known Limitations
- No sound effects (visual feedback only)
- No multiplayer support
- Fixed screen resolution (1280x720)
- No save/load functionality
## Development
### Code Structure
```
DeathCircuit/
├── main.py # Game loop and state management
├── config.py # All game constants and parameters
├── player.py # Player class with movement and combat
├── enemy.py # Enemy classes and spawner
├── weapon.py # Weapon system with 4 weapon types
├── bullet.py # Bullet physics and collision
├── map.py # Procedural arena generation
├── ai_behaviors.py # Intelligent enemy AI
├── particle_system.py # Visual effects system
├── ui.py # HUD, menus, and displays
├── collision.py # Collision detection utilities
├── utils.py # Mathematical helper functions
└── README.md # This file
```
### Extending the Game
The modular design makes it easy to add new features:
1. **New Weapons**: Add new weapon classes in `weapon.py`
2. **New Enemies**: Add new enemy types in `enemy.py` with custom AI in `ai_behaviors.py`
3. **New Maps**: Extend map generation in `map.py`
4. **Power-ups**: Add collectible items in the game loop
5. **Sound**: Integrate pygame.mixer for audio feedback
## License
This game is provided as-is for educational and entertainment purposes. Feel free to modify and extend the code.
## Credits
Created with Python and Pygame. Inspired by classic top-down shooters and modern arena combat games.
---
**Enjoy the game!** Survive the circuit and reach the highest wave!# wave_game