{"repo":"pygame-web/pygame-web.github.io","free":true,"listed":false,"github":"https://github.com/pygame-web/pygame-web.github.io","clone":"git clone https://github.com/pygame-web/pygame-web.github.io.git","description":"Run python and pygame code in your html","language":null,"stars":59,"topics":["pygame","cdn","pygame-wasm","webassembly"],"license":null,"category":"game-templates","readme_excerpt":"pygame-web.github.io This is the CDN root used by Pygbag. (pronounce pig-bag) The wiki. Source code Old runtimes and current Pygbag does not track usage at all, not even for statistical purposes. If you like it, please star the repository! (Very) important points Also, read the page on making your code compatible with browser game loop. You will probably have to change some of your code. All operating systems - Name your main game script main.py and put it in the root folder of your game. - Make your main loop async-aware and use asyncio.sleep(0) every iteration to give control back to the main thread. - Add --template noctx.tmpl to pygbag command line if using 3D/WebGL. - Put the import statements of complex packages in order (but numpy first) at the top of main.py . - Avoid using CPython's standard library for web operations, GUI (like tkinter), or I/O as it is very synchronous/platform-specific and will probably stay that way. In terms of GUI alternatives, pygame gui works on top of pygame-ce, Panda3D provides directgui and Harfang3D provides imgui. They are all cross-platform. - You can add a square image file named favicon.png in your game's root folder to make Pygbag use it as the web package's favicon. - Make sure all audio files are in OGG (best compression format targeting 16bits 24Khz Mono). (that is especially not in WAV/AIFF/M4A/MP3 format ) - Avoid raw formats like BMP for your image assets, they are too big for web use; use PNG/WEBP or JPG instead. - Filenames a","default_branch":null,"files":null,"tree":[],"storefront":"/r/pygame-web","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/pygame-web/pygame-web.github.io/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}