I'm writing a simple game with python, pygame and py2app. (I use python 2.6) When I build my game in alias mode, it works fine, but when I build for deployment, the app I get crashes immediately after lunching. Anyone know what's going on?
1
votes
No code? No error messages? No nothing? How on earth are you expecting people to figure out whats wrong?
- Mizipzor
There is no error message when it quits. I have figured out (after I posted the question) that it has something to do with pygame font. It does not happen when I remove everything having to do with font. I also believe that it is a combination of things as it was very hard to pin point.
- Teak
try to see what is outputed in the console: do "open -a Console.app", relaunch your app, see the message log, copy and paste here.
- meduz
1 Answers
5
votes
To provide a more thorough answer to this whole issue, I'm going to use the aliens.py example. When built in OS X, you will see quick flash as the game quickly initializes and quits. Opening console reveals an error message similar to
Fatal Python error: (pygame parachute) Segmentation Fault
Job appears to have crashed: Abort trap
I believe the issue is that the default font is not being included during the packaging process.
In the aliens.py sample for instance, throw a supported font into your data folder and change
self.font = pygame.font.Font( None ), 20)
to
self.font = pygame.font.Font( os.path.join('data', 'Copperplate.ttc'), 20)
This should allow the app to complie and play without issue.