Let's say you've just started building a game using Pygame or just thinking about it and you're looking for a readily available template that you can use to code, test, and deploy - then this repo is for you
- What is does?
- Gameplay
- Purpose of each component?
- How to Add New Games?
- Build With
- Setup Environment for local
- FAQs
Deploy any of your pygames code to web with a single push with Bunnyshell Environment as a Service (EaaS) platform
We've a total of three components in our environment dev, stg, and prod
- This is a safe place to try out new things, push as much code as possible
- Making a push to the
dev
branch will redeploy the code
- This is a place to test all the functions and share it across the team to start the verification/testing
- Merge your dev branch with
stg
branch to trigger a deployment
- This is a place to share it with wider audience and the live application is here
- Push to
main
only if all the test cases and checks are cleared - Merge your stg branch with
main
branch to trigger a deployment
It's an extremely easy process (having a lot of steps), follow the steps below:
- Add your entire game to
/pygames
folder in the repo - Make sure to build the game locally as instructed here
- You've to edit the Dockerfile inside
/pygames
folder, add a path in mkdir command of the game you're trying to add - Add a line in copying the game folder inside the container (it can be optimized to just one copy - working on it)
- Add a line to build the new game you've just added with Pygbag
- Add the path of the new game you've added inside the nginx image
- Copy the new game build from the
pygame_build
stage toprod
- Python - General Programming
- Pygame - Writing Game Logic
- Pygbag - Python WebAssembly for everyone ( packager + test server )
- Docker - Build and deploy the game
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python3 pygames/classic_hunt/main.py
python3 -m pygbag pygames/classic_hunt/
-
My game is not loading up at localhost:8000?
- Please use this step to verify it works on just Python before trying to build with Pygbag, running this way will given you a hint of any exception you might not have handled in the game logic
-
My game assets are not getting build properly in docker?
- Please make sure you're copying the game assets to the right folders in the Dockerfile, I know there are many moving parts in the Dockerfile, you can copy any example line and just edit the path
-
Game audio files are not working?
- Pygbag wants your audio files to be in
.ogg
format so please convert all your audio files to.ogg
format if not already
- Pygbag wants your audio files to be in
Space Invaders - leerob, Classic Hunt - sumosp, Flappy Bird - cprakash64, and Street Fighter OyeMad