0

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!

  • did you run it manually in console/cmd/powershell ? did you get error message or it closed console/cmd/powershell ? – furas Oct 11 '16 at 11:22
  • I just ran it in powershell with .\game.exe and I got a NotImplementedError for the mixer module. I'd seen that before when trying to make the exe and it went away for some reason when I did a fresh install of pygame I think? – B.A. Ceradsky Oct 11 '16 at 11:27

0 Answers0