pygame-web / pygbag

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

Where am I failing? #123

Closed ThorvaldAagaard closed 1 year ago

ThorvaldAagaard commented 1 year ago

When i run my pygame using pygbag i get the following error:

image

my main.py is referring these local modules like this: image

I can see all the script files for these modules are included in the apk-file in directory assets (same level as main.py)

image

So it seems to be looking for my own modules in the CDN. Should I copy all modules into main.py, so I only have one file?

pmp-p commented 1 year ago

We cannot tell from just those screenshots, please provide a github project/page or a itch web.zip archive (--archive) of whole project you give to pygbag.

ThorvaldAagaard commented 1 year ago

This repository: https://github.com/ThorvaldAagaard/bridge-with-ben

It is not a complete application, but running python main.py from the game directory gives: image

Running pygbag game and then going to http://localhost:8000/?-i gives the CDN-error

web.zip attached it that is easier than cloning my repository web.zip

pmp-p commented 1 year ago

you had some blocking while loops https://github.com/ThorvaldAagaard/bridge-with-ben/pull/1/files

ThorvaldAagaard commented 1 year ago

Thank you. So on any drawing in a loop remember to sleep to avoid the blocking.

and this is just some information that can be ignored

1103: list_imports len(code)=7414 file=None hint=PosixPath('/data/data/game/assets/main.py')
1095: scan_imports hint=PosixPath('/data/data/game/assets/main.py') filename='<stdin>' len(code)=7414 ['table', 'drawing_func', 'player', 'buttons']
1132: repo['-CDN-']='http://localhost:8080/archives/repo/' does not provide want='table'
1132: repo['-CDN-']='http://localhost:8080/archives/repo/' does not provide want='drawing_func'
1132: repo['-CDN-']='http://localhost:8080/archives/repo/' does not provide want='player'
1132: repo['-CDN-']='http://localhost:8080/archives/repo/' does not provide want='buttons'
628: aio.pep0723.check_list env=PosixPath('/usr/lib/python3.11/site-packages')