For others to be able to play your game online, you need to publish it since pygbag is not ( and should not be) reachable from outside your local network. Itch.io allows you to do that and more.
To upload you website to itch.io you would need to zip its source code and upload it to itch.io
Use python3 -m pygbag --archive the/game/folder/main.py
and get the web.zip from ./build/web.zip in the game folder
or :
- go inside your game folder
- go inside the build folder
- go inside the web folder
- then select the contents inside the folder
- zip those contents
To set up the project:
- Create a new project.
- Select the HTML Kind of project.
- Upload the web.zip you got ealier via the upload interface of the project.
- Select
This file will be played in the browser
- Then save your project
More information can be found here. After following these steps, if you view your game page, you would be able to see your game. If you update your games frequently, you can use butler, a command-line tool made by the developers of itch.
After following these steps, if you view your game page and set it to public, then you would be able to see your game.
Though, if you are unable to do so, you can ask for help in the pygame discord server