Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+2)

By default, a python game (.py) cannot be run as an HTML game.

What you should do is use the "pygbag" package to export your game to HTML format (I don't remember if it is mandatory to also use pygame).

If you've never used pygbag before, it's best to look up tutorials, since you need the main function to be asynchronous.

(+1)

I did try pygbag, It only resulted to getting black screens and getting errors , I did check the debug page of the pygbag export but it didn't really help. 

You will have some error in the code.
I have used pygbag for a JAM and it worked without any problem.

You must program thinking about pygbag, a normal game of pygame won't work if you don't adapt it to pygbag.

(+4)

I did fix it after all by getting help from the pygame community discord, The main issue was that the sound clips weren't in .ogg format, and that I forgot to add await asyncio.sleep(0) after every While True function.