pygame-web.github.io

CDN root used by pygbag

Github repo

This software does not track usage at all, even for statistics purpose so if you like it : please do not forget to star it !


Pygbag packager WIKI

IMPORTANT: Please do not use wav/mp3 audio formats when packaging, pygbag 0.1.5+ will not work.

sfx sound patch need ogg format ( if linux+ffmpeg conversion is automatic, on windows you can use audacity ).

Adapt your code this way if you still want wav format on desktop :

if sys.platform == "emscripten":
    snd = pygame.mixer.Sound("sound.ogg")
else:
    snd = pygame.mixer.Sound("sound.wav") # or .WAV,.mp3,.MP3

Coding for WASM

Coding with pygbag

Enter Debug mode

pygame-script (wip!)

Demos on github pages :

(for testing, may not always work since they use daily/weekly devel version)

heavy cpu load not for low-end devices:

Perfect Rain

Alien Dimension

Light cpu load :

Breakout

PyChess

Penguins Can’t Fly !

view code from above games and others on github

[view the code]

Please ! use the tag pygame-wasm for your projects hosted on Github and also add a favicon.png icon 32x32 next to your game main.py, so it is picked up by default.

Demos on itch.io:

( expected to be stable )

games on itch.io

Early demos ( may not fully work as intended ):

pygame tech demo PyCon DE & PyData Berlin 2022

Galaxy Attack


Technology:

devlog

Python Wasm explained by core dev Christian Heimes (youtube video)

current status

explore current issues

PyPI stats

pyodide/pyscript

Thanks for supporting pygame and pygbag. Without support now, there won’t be pygame or pygbag later.

Hello from the pygame community.

edit this page