Pygame game packaged for the web with Pygbag.
Constelations is a small Pygame demo that draws moving dots and connects those within a certain distance, with an interactive control panel to adjust speed, number of points, and connection distance. With Pygbag, it can run in modern browsers as a WebAssembly application.
Important Note
The original idea for this animation is not mine. I do not claim it as my own nor am I the rightful owner of its intellectual property. It is an attempt to replicate an animation I saw while browsing the internet. I have been unable to locate the original animation again and therefore cannot credit the creator.
- Python working on ≥ 3.8.x and < 3.12.x - [3.8.x, 3.12)
- pygame-ce (community edition of Pygame)
- pygbag ≥ 0.8.1 (recommended 0.9.2)
- Clone or download this repository.
- Create and activate a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # Linux / macOS venv\Scripts\activate # Windows
- Install the dependencies:
pip install --upgrade pip pip install -r requirements.txt
- Package the current folder with Pygbag:
python -m pygbag .
- Open in your browser:
http://localhost:8000
- For debug mode (interactive REPL):
http://localhost:8000?-i
Constelations/
├── main.py # Game source code (async)
├── assets/ # Images, sounds, and fonts
├── requirements.txt # Python dependencies
└── README.md # This document
- Adjust
main.py
if you add new assets or dependencies. - You can create a ZIP ready for itch.io with:
python -m pygbag . --archive
This project is licensed under the MIT License.