7
\$\begingroup\$

I have a Pygame game, and I was wondering if there was any way to embed it into a webpage to make it easily playable, or if there is a games website that accepts Pygame games.

EDIT: I am now using Unity and am not after the answer anymore, but please answer if you want as it could help others.

\$\endgroup\$

2 Answers 2

7
\$\begingroup\$

You could look at Skulpt.org which provides a completely brower-based implementation of PyGame. However I do not know what external APIs PyGame uses and which are supported by Skulpt.

Edit: it seems Skulpt also has WebGL bindings so this should be very possible!

\$\endgroup\$
1
  • \$\begingroup\$ I have tried several options. Trinket.io didn't work well to me since it is cropping the game screen. itch.io requires a downloadable file which I didn't have I tried to use skulpt.org, but it didn't even open. So I ended up using replit.com, since this was the only site that didn't crop the game and could host pygame app in browser \$\endgroup\$
    – Patlatus
    Commented Apr 2, 2023 at 16:58
0
\$\begingroup\$

While poking around looking for PyGame GUI toolkits I came across these two libraries: PyJ2D: http://gatc.ca/projects/pyj2d/ PyJSDL: http://gatc.ca/projects/pyjsdl/

The both seem to allow the execution of PyGame scripts in a browser, the first through Jython and a Java applet and the second through Javascript and HTML5.

I've never used either but they seem to be what you are after.

\$\endgroup\$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .