Small test made using Python + Pygame + pygbag. 

Awesome!

Here is how I've made it:

Step 1: Install pygbag

Simply run "pip install pygbag" in your machine, assuming that you have python3+ installed and added to your environment variables.

Step 2: Sample code

Your game's main loop MUST be async. There is a lot of ways to do that in python, but since this is not the point of this short tutorial, here is a dumb example on how to do it (this code will actually work, btw, I've tested it):


Step 3: Export it!

Before you export, just make sure that:

  • Your project MUST be in a folder.
  • The main file MUST be called "main.py".

Then just run in the terminal: "pygbag <folder_name>". And that's it, you'll have a build folder with a "web" folder inside. Just zip this web folder and upload to itch.


StatusPrototype
PlatformsHTML5
Rating
Rated 5.0 out of 5 stars
(1 total ratings)
AuthorUniday Studio

Comments

Log in with itch.io to leave a comment.

Thanks for this! I've been wondering how one might be able to make a web build with pygame. I'll definitely try this out! :)