PS - I've had a go at writing a game using Pygame. You have to download it I'm afraid - I can't make mine run online :( - but if you are interested, it's here https://2-tape-software.itch.io/in-a-flap
Viewing post in Mypysky platformer browser game is available
I have used pygbag https://pygame-web.github.io/wiki/pygbag/ to convert my game. You can try that too