It looks like you may have reintroduced a crash bug (import bug) on Linux (?!), which I again just fixed now, so it’s worth explaining.
TLDR: to resolve recursive imports, we import a.b.C
instead of from a.b import C
We have a depdency cycle; here’s a crash stack:
Traceback (most recent call last):
File "main.py", line 30, in <module>
from shooter.player import Player
File "/home/user/Dropbox/Python/pcg-shooter/source/shooter/player.py", line 8, in <module>
from shooter import obj
File "/home/user/Dropbox/Python/pcg-shooter/source/shooter/obj.py", line 643, in <module>
from shooter.bullets.bullet import Bullet
File "/home/user/Dropbox/Python/pcg-shooter/source/shooter/bullets/bullet.py", line 2, in <module>
from shooter.bullets import rocket, basic, melee, explode, railcharge
File "/home/user/Dropbox/Python/pcg-shooter/source/shooter/bullets/basic.py", line 2, in <module>
from shooter import obj
ImportError: cannot import name 'obj'
It looks like the cycle is main.py
=> player.py
=> obj.py
=> bullet.py
=> basic.py
=> obj.py
The resolution is, everywhere (or in particular, in basic.py
for a quick fix), use import shooter.obj
instead of from shooter import obj
.
This works because import shooter.obj
does some sort of future-declaration where it says “oh yeah when this thing is imported, come back and we’re good” instead of “import this right now and oops, we’re not done importing that so we can import that.”
I’m trying to build the final binaries and it’s frustrating that things keep breaking. Apparently, hiding the splash screens also hid another bug.
I also added source image files and reorganized the folder structure.
I’ll do more testing tonight inshaAllah on the final binaries and ship it if it works. If you would like to help (I’m waiting for your feedback on the January thread), please run build.bat
and then dist/main.exe
to see if you find any bugs. After pulling from master
.