pygame-web / pygbag

python and pygame wasm for everyone ( packager + test server + simulator )
https://github.com/pygame-web
MIT License
319 stars 36 forks source link

Pygbag Pygame screen is just black after loading #133

Closed Visssarion closed 10 months ago

Visssarion commented 10 months ago

After I build my game with following command: pygbag endless_fusion_web And after clicking "Ready to start" on localhost:8000 i am being presented with black screen image When launching main.py on the system itself, game loads just fine.

Here's a link to source code of the project: https://github.com/Visssarion/endless_fusion/tree/web_version And here's main file: https://github.com/Visssarion/endless_fusion/blob/web_version/main.py

Visssarion commented 10 months ago

I am using terminal through Pycharm, although doubt that changes anything

pmp-p commented 10 months ago

You should have seen the problem when using debug mode with http://localhost:8000?-i

from what i've got with above source i think in pygame-ce 2.3+ lerp() has moved as optimized methods for Vector2/3 and those don't require pygame.math import anymore (use pygame.Vector2)

pmp-p commented 10 months ago

also your fullscreen manager is not web compatible just replace it by a fixed reasonnable screen size ( eg 1024x600 ) and let browser handle hardware scaling shot-2023-11-12_1699810430

Visssarion commented 10 months ago

Thank you so much! I did this and it worked. When i heard about debug mode i thought about a standart browser console, i did not know there was a proper debug mode.

If I ever make a devlog about development of this (or a video on "how to fix black screen") i will mention about debug mode. Sorry for inconvinience.