Dino Game
About
A dinosaur-themed game built with Pygame, connected to a Flask API and MySQL database. Players choose a unique username for the dinosaur and aim to jump over obstacles using the spacebar or up arrow for as long as possible. Scores are saved automatically to a leaderboard so players can track and compare their performances across sessions.
Project Structure
.
├── assets
│ ├── audio
│ │ ├── game-music.mp3
│ │ ├── game-over.mp3
│ │ └── jump.mp3
│ ├── ground.png
│ ├── noon.png
│ ├── sky.png
│ ├── tree.png
│ └── trex.png
├── LICENSE
├── pyproject.toml
├── README.md
├── src
│ ├── backend
│ │ ├── api.py
│ │ ├── config_template.py
│ │ ├── config.py
│ │ ├── db
│ │ │ └── schema.sql
│ │ └── db_utils.py
│ ├── frontend
│ │ ├── api_client.py
│ │ ├── button.py
│ │ ├── constants.py
│ │ ├── dinogame.py
│ │ ├── displayfunctions.py
│ │ ├── gamerun.py
│ │ ├── gamestate.py
│ │ ├── local_scores.py
│ │ ├── obstacle.py
│ │ ├── obstaclefield.py
│ │ └── player.py
├── tests
│ ├── test_api.py
│ ├── test_dino_game.py
│ └── test_local_scores.py
└── uv.lock
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /players |
Creates a new player with a username |
| POST | /game_runs |
Starts a new game run for a player |
| PUT | /game_runs/<id> |
Updates the score and end time of a game run |
| GET | /leaderboard |
Fetches the top 10 scores |
| DELETE | /game_runs/<id> |
Deletes a specific game run |
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/[name-of-feature-branch]) - Commit your changes (
git commit -m 'Add some [name-of-feature]') - Push to the branch (
git push origin feature/[name-of-feature-branch]) - Open a Pull Request
Credits
Developed by Anna Zhang, Boon Chin Look, Julia Kaczmarek, Katrina Griffard, May Tedros, Ogechi Izegbune - 2026.
This project was developed as part of a coding bootcamp to demonstrate practical software engineering skills, including Pygame, Python, Flask, SQL, and Version Control. All images and videos included are used strictly for educational purposes.