An interactive Pokémon identification game built with Flask, Python, JavaScript, and the PokéAPI.
This project is an interactive Pokémon learning game designed to help players recognize and learn Pokémon through repeated identification challenges.
Each round randomly selects a Pokémon and presents the player with multiple possible answers. Players receive immediate feedback and can track their score and accuracy as they continue playing.
The application combines a Flask backend with the PokéAPI to dynamically retrieve Pokémon information, sprites, and names.
Each round displays a randomly selected Pokémon with four possible answers. One answer is correct while the others are randomly generated choices.
The game tracks correct guesses, total guesses, score, and overall accuracy throughout the session.
Players can save Pokémon to a personal collection and view the Pokémon they have discovered during the game.
After every guess, the application loads a new Pokémon and generates a fresh set of possible answers.
Flask manages the game routes, session state, Pokémon retrieval, scoring, and player collections.
The application uses the PokéAPI to retrieve Pokémon information instead of maintaining a manually created database of Pokémon.
JavaScript handles communication between the game interface and Flask without requiring the player to manually submit a traditional HTML form.
When a player selects an answer, JavaScript sends a request to the Flask endpoint:
fetch(`/pokemon-guess/${guess}`)
The server evaluates the answer and returns JSON containing whether the guess was correct, the correct Pokémon, the updated score, and the player's accuracy.
Handles routes and game state
Provides Pokémon data
Handles player interaction
Tracks game progress
This project gave me experience connecting a Python web application to an external REST API and using the returned data to create a dynamic interactive experience.
It also provided practical experience with Flask sessions, asynchronous JavaScript requests, JSON responses, random data generation, and designing game logic for a web application.
Most importantly, the project demonstrated how traditional web development techniques can be combined with game mechanics to create an engaging learning experience.