I'm looking to incorporate Pygame into a website I'm developing to showcase my projects. I know about pygbag, but I've noticed it loads my programs slowly. Does pygbag only work with single Python files, or can it handle multi-file games too? Are there any other options for getting my games online without requiring users to download anything?
2 Answers
I hear you on the loading times! It can depend on whether it's the code or the assets that slow things down. When you test, what's taking the longest? I mean, those images and sounds can really add up and might be the culprits here. Make sure to check your resources too!
You might want to check if your assets are the bottleneck. Even smaller games can grow hefty with too many images or sounds, which can impact load times.
Using Pygame on the web can be a bit tricky since it wasn't originally made for browsers. Pygbag can work with multi-file setups, but as your game grows, the load times and asset management can get messy unless you really cut down on your assets. A lot of developers end up switching to web-native frameworks for better performance, or they just make a demo or video instead. This way, you avoid those frustrating loading issues that can leave users annoyed if things hang or fail to load properly.

It’s definitely the program itself that’s taking too long to load in the browser. I’ve run tests across various browsers and get similar slowdowns. Any tips on better methods for deploying multi-file games online?