|packaged pygame app hanging on launch||John Saba||5/14/12 6:21 PM|
I've packaged a game using py2app on and have a strange problem when trying to open it. If the app is opened in the normal way, the window "hangs" before being displayed. If the app icon is clicked in the dock, the window is shown, otherwise it isn't but the game still responds to input. As it runs in fullscreen, this means you have to click the dock icon in the split second it pops up before the screen goes black and you are stuck.
However... if you open the bundle and go into contents / macOS and open the app from there then it opens fine! My first solution was to just include an applescript app that forces the application to open (which works)... but that breaks if you try to move the folder anywhere at all. Crappy solution to begin with I know, plus I'm selling the game so I really can't do it that way. It should be able to be dragged into the applications directory and open from there.
Here's the app bundle + the applescript: http://dinopuzzlegame.com/wp-content/uploads/2012/05/dinosInSpaceFree.zip. Here's the website for verification of what your downloading: http://dinopuzzlegame.com/. It's kind of confusing but the game application is named "gameMain.app" while the applescript is named "dinosInSpace.app" and has the dino icon. I did it that way thinking I was going to ship it like that but will change it if I'm able to figure this problem out. So if anyone wants to try the game either run dinosInSpace.app or open the gameMain.app bundle then go into contents / macOS and run the gameMain from there. To reproduce the error, just run gameMain.app from the main directory.
python2.5 (from .org, not apple provided one)
built on os 10.6.8 lion
Thanks for any help, I haven't been able to find any solutions elsewhere,
|Re: packaged pygame app hanging on launch||John Saba||5/15/12 8:27 AM|
Alright, so I think I've found a solution. Calling the applescript from python in top py file seems to work - even when the file is edited in the bundle after being built. So I deleted the other file, here's the new one:
It should work like a normal app and be able to be dragged from the installed folder to the applications directory. If anyone tries it let me know if it works, thanks.