A simple pygame-based arcade game where you control a robot, collect coins, avoid monsters, and use hearts to restore health.
The game was built with pygame, packaged for the web with pygbag, and deployed inside a Docker container.
- Robot character that can move left and right.
- Falling coins to collect for score.
- Monsters to avoid (lose health on collision).
- Hearts to restore lost health.
- Game states:
- Menu → Start screen
- Playing → Core gameplay
- Game Over → When health reaches 0
- Win → When all coins are collected
- Clone the Repository
git clone https://github.com/yourusername/robot-game.git
cd robot-game- Install Dependencies
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt- Run the Game Locally
cd deploy && python main.py- Running in Browser with pygbag
To export and run the game in the browser:
pygbag main.pyThis will build the web export inside a folder (usually build/web/). Open the generated link in your browser to play the game online.
A Dockerfile is included for hosting the game on the web.
- Build the Docker Image
docker build -t robot-game .- Run the Container
docker run -p 8080:80 robot-gameThe game will now be available at http://localhost:8000
The Docker image for this project is available on Docker Hub:
You can pull and run the image directly using:
docker pull joaonunovalente/robot-game
docker run -p 8080:80 joaonunovalente/robot-gameThen, access http://localhost:8080
The game is live and playable at:
This project was developed as the final project for the University of Helsinki | Introduction to Programming course and Advanced Course in Programming.