Using pgame in pyscript

Hi,

do anyone use pyscript together with pygame?

Best regards Hebi

1 Like

dear hebi

Pygame needs a lot of computing speed, right?
The trouble is that you have to increase the power of pyscript.net’s cloud server by 10 to 100 times … Maybe it will be a boring game, right?

To solve this problem,

  1. To be able to install on the local server (solved)
  2. To be able to drive powerful arithmetic units such as GPU (currently in progress, various drivers are under development)
  3. Configure a library that game developers will want to use (this is owned by the game vendor)

That’s right.

A toast for the future that is about to begin.

Regards, you.
ktsh.tanaka.2020

It’s not quite what you asked, but you may want to take a look at various links here:

They’re using wasm to get pygame working on the web

3 Likes

If you want to follow along with development take a look here: pygame for web browser · Issue #718 · pygame/pygame · GitHub

3 Likes

PyScript + Pygame is tricky — SDL backend doesn’t run natively in browsers, so you need a workaround.

Two approaches:

  1. Pygbag — packages Pygame games to WebAssembly. Works with PyScript but adds bundling complexity.

  2. Pyodide + Pygame-CE — has experimental WASM support. Cleaner but limited audio/input.

For action-heavy games like rhythm platformers (think mobile rhythm game style with tight input timing), native Android via Kivy or Buildozer outperforms browser-based Pygame every time. Browser is fine for puzzles, not for reflex games.