Great news: How to run a videogame made in Python into the Browser!

Опубликовано: 27 Февраль 2025
на канале: John Starfire
882
12

This thing was one of the most awaited thing every pythonista was looking for and now it's here and it's really easy to do! Well we can run a python game made with pygame (but not onlu games of course) with pygbag and very few modifications of the code. The game runs just like in the windows of Windows or MacOs of Linux. I think this will be the start of a revolution that will bring a lot of videogames and app made in python to run in millions of browsers. So, let's get into this new chance that was made doable with wasm.
P.S.: do not look at the frame rate of the game you see in the video, the frame rate is fine, it's my video that has a low frame rate, so do not worry, it runs just like in a normal window of pygame.

https://pythonprogramming.altervista....
The example (the code isn't mine, it's just to show an example of how it works) https://pythonprogrammi.itch.io/tetris

The code for the game
https://github.com/educ8s/Python-Retr...
You need to do the change you see in the video and also convert the 2 mp3 files in ogg. I used ffmpeg -i all.mp3 all.ogg (you will need to install ffmpeg that is free.