Been away from panda for a bit and just came back. love the new site’s look and organization.
I downloaded 1.7 and was glad to see the code I’d written in 1.6 was still running fine. Reading through the manual, I noticed the newer way (to me anyway) of structurung the program. Namely:
from direct.showbase.ShowBase import ShowBase
app = MyApp()
so i modified my code a bit to do it this way. I had code like this:
from direct.showbase import DirectObject
g = MyGame()
Like I said my code worked fine, but after I changed it - it bombs out with exit code 1.
Can’t find a reason why. I even created a new py file with just the 6 lines in my first code example (right from the manual) and panda won’t start up.
Yeah, this is exactly why I revamped the A Panda Hello World tutorial to use ShowBase instead of DirectStart. The old way got people dependent on everything being up and ready to go after a single import line.
‘loader’ is a member of ShowBase, though it is also stashed into builtins to make Python treat it as a built-in function (along with the likes of hasattr() and isinstance()), which means the user can call it anywhere in the entire program without importing a thing. This is why you can run even self.GAME_FONT = loader.loadFont() without it crashing. Since your program’s main class is inheriting from ShowBase, you could also write self.GAME_FONT = self.loader.loadFont(). The point being that it’s ShowBase.loader that you’re using.