A feature-rich Pokémon battle simulator built with Flask, HTML, CSS, and JavaScript. This web application allows players to engage in strategic turn-based battles with authentic Pokémon mechanics, including type advantages, strategic movesets, and dynamic battle animations.
- Authentic Pokémon Battles: Experience turn-based battles with official Pokémon mechanics
- Strategic Movesets: Pokémon come with optimized movesets based on their type and abilities
- Type Advantages: Full implementation of Pokémon type effectiveness (super effective, not very effective, no effect)
- STAB (Same Type Attack Bonus): Moves matching the Pokémon's type deal 1.5x damage
- Critical Hits: Random critical hits add excitement to battles
- Damage Variance: Moves deal 85-100% of their maximum damage
- Animated Sprites: Gen 5 animated sprites for authentic Pokémon appearance
- Dynamic Health Bars: Color-changing HP bars based on remaining health
- Battle Animations: Visual feedback for attacks, damage, and status effects
- Sound Effects: Authentic Pokémon cries and battle sounds
- Background Music: Immersive battle music (add your own music files to the
musicdirectory)
- Responsive Design: Works on desktop and tablet devices
- Real-time Updates: Dynamic UI updates without page refreshes
- Battle Log: Detailed log of all battle events
- Scalable Architecture: Clean separation of concerns between frontend and backend
- Python 3.8+
- pip (Python package manager)
- Modern web browser (Chrome, Firefox, Safari, or Edge)
-
Clone the repository
git clone https://github.com/PersesKyogre09/pokemon-battle-sim.git cd pokemon-battle-sim -
Install dependencies
pip install -r requirements.txt
-
Run the application
python web_server.py
-
Open in your browser Visit
http://127.0.0.1:5000/to start playing!
-
Start a Battle
- Visit the home page and click "Start Battle"
- Choose your Pokémon from the selection screen
- The game will automatically select an opponent for you
-
Battle Controls
- Click on a move button to attack
- Watch the battle log for turn-by-turn updates
- Monitor HP bars to track battle progress
-
Winning the Game
- Reduce your opponent's HP to zero to win
- If your Pokémon faints, you lose the battle
pokemon-battle-sim/
├── data/ # Data files and type effectiveness charts
├── music/ # Background music (add your own files here)
├── static/
│ ├── css/ # Stylesheets
│ ├── js/ # Frontend JavaScript
│ └── sounds/ # Sound effects
├── templates/ # HTML templates
│ ├── battle.html # Main battle interface
│ └── index.html # Home/selection screen
├── data_loader.py # Handles loading Pokémon and move data
├── game.py # Core game logic
├── move.py # Move class and damage calculation
├── moveset.py # Strategic moveset generation
├── pokemon.py # Pokémon class and battle logic
└── web_server.py # Flask web server and routes
- The game uses PokeAPI to fetch Pokémon data, so an internet connection is required
- For offline play, you'll need to implement a local cache of the required data
- Add your own music files to the
musicdirectory and update the references intemplates/battle.html
Contributions are welcome! Feel free to submit issues and pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
- PokeAPI for the comprehensive Pokémon data
- Flask for the web framework
- Pokémon Showdown for the moves, typechart logic, and learnsets datasets (MIT license)
- Pokémon and all related content © Nintendo, Game Freak, and The Pokémon Company



