I have finished my game (finally) and I want it to be in a format that anybody can have it and play it, without making sure they have python and pygame installed first. I've been trying for several days to figure out py2exe (I know it's my first attempt, but they really make it sound MUCH easier on the website to do this) and after I finish that I'll do the same for py2app.
I finally made a successful compile of my game, but when testing it out, I found that the console closed when it reached the credits. No error occurred as far as I can tell, there was no log that was created, it just closed out.
This does not happen when I run the game through python, only through the created .exe file.
Upon further inspection, I commented out the pygame.mixer
lines and it ran through just fine. I really want a song to be playing during the credits and I just can't figure out why it doesn't work. Here are all the lines that I use for the mixer, its not a lot.
import pygame
...
pygame.mixer.init()
pygame.mixer.music.load("bensound-epic.wav")
pygame.mixer.music.play()
...
Then the credits...
while pygame.mixer.music.get_busy():
continue
But as soon as the script hits pygame.mixer.init(),
it seems to just say "ok, I'm done. Good work everybody!"
Thanks in advance for the help!