Tank Turn Game is a multiplayer tank battle game built with Python and Pygame. Players control tanks, taking turns to move, aim, and shoot at each other. The game features different types of tanks, player statistics, and a backend server for user authentication and data persistence.
The project is divided into two main parts: the game client and the backend server.
src/
)main.py
: Entry point for the game clientapp/
: Main application directory
core/
: Core game logic (game manager, object controller)models/
: Game object models (tanks, bullets)views/
: Game views (menu, stats, game)util/
: Utility functionsconfig.py
: Client configurationbackend/
)src/
: Source code for the backend
app/
: Main application directorydatabase/
: Database connection and queriesmodels/
: Data modelsroutes/
: API routesservices/
: Business logicmain.py
: Entry point for the backend servertests/
: Backend testsfeatures/
: Behavior-driven development featuresgrafana/
and grafana_data
)grafana
:
dashboards
: Containts .json dashsboards to import.grafan.ini
: Configuration SMTP file for alerts.grafana_data
: To initialize volumen.prometheus_data
):prometheus_data
:
prometheus.yml
: Prometheus configuration file,docs/
):docs
: Contains Markdowns with the contributions of each member.For this project we are using Python >= 3.12 and Docker Engine >= 27, it is not test in other versions.
Due we are using pygame
for our projectm we only used Docker for the backend, so you will need to setup and python enviroment a build the containers wiht docker compose
Using run.sh
file
run.sh
file.chmod +x ./run.sh
sudo ./run.sh
Enjoy our game.
Manually setup.
grafana_data
directory:mkdir grafa_data
docker compose up --build -d
This commando builds our container in compose.yml
.
Our container:
prometheus
mongodb
mongodb_exporter
grafana
backend
If you want to see any container's log, you cand execute:
docker compose logs <container_name>
Once it is completed our backend at localhost:8000
, let's to initialize our game.
Let's create a python enviroment:
python3 -m venv venv
Activate it, if you are in linux run this:
source venv/bin/activate
Install the required dependencies:
pip install -r requirements.txt
Finished, let's enjoy our game:
python3 src/app/main.py
The project includes a GitHub Actions workflow (ci.yml
) for continuous integration, which runs tests and checks code formatting.
For detailed information, please refer to the following documentation: