A Python-based turn-based battle game with two modes:
- Player vs Player (PvP) – Local multiplayer mode
- Player vs Computer (Bot) – Battle against an AI opponent
The PvP version is a graphical game using Pygame, while the Bot mode is a text-based console game.
Attack\_defence-game/
│
├── assets/ # Game graphics for Pygame version
│ ├── P1\_Shot.png
│ └── P2\_Shot.png
│
├── Attack\_game.py # Player vs Player (Graphical - Pygame)
├── attack\_with\_bot.py # Player vs Computer (Console)
└── README.md # Documentation
- Built with Pygame
- Visual HP bars and battle log
- Multiple move types: Quick, Normal, Heavy, Defend, Heal, Special
- Critical hit chance
- Restart option after a win
- Simple text-based gameplay
- Two actions: Attack (10–20 damage) or Defend (halve next damage)
- Computer makes strategic decisions based on HP and chance
- Quick to run in any terminal
- Python 3.x
- Install Pygame:
pip install pygame
- Python 3.x
- No extra libraries required
python Attack_game.py
python attack_with_bot.py
- Player 1 and Player 2 take turns clicking attack/defend/heal/special buttons.
- HP bars update in real time.
- First player to bring the opponent’s HP to 0 wins.
- Player 1 types
attack
ordefend
when prompted. - Player 2 (the bot) chooses its action automatically.
- First to reduce opponent’s HP to 0 wins.
- Add online multiplayer
- Improve bot AI for more challenge
- More animations and sound effects
- Expand console mode to include PvP