I am working on a problem with my 2D arcade game programed with Python using the module pygame for 2 days now and I can’t find a solution.
The problem is: I want to create a Windows Executable File that is running my program correctly. I already managed to create a .exe file, but I get an error as soon as I start the exe:
Runtime Error!
Path\MyGame.exe
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
I tried to create the .exe file with every module that makes it easy to build one, for example cx_freeze, py2exe, pyinstaller. At the end it doesnt matter which one I have used, I got the same error. I already tried to start the .exe file with another PC, it failed. Updated my Microsoft Visual C++ Redistributable, nothing helped.
So the fault must be somewhere in my code. The program is running correctly, but there must be something that prevents me from making a .exe file that works fine.
The code has around 1000 lines, I know it’s too much to ask for someone checking the whole code but I hope someone had a similiar problem to this or have some tips why this error is appearing and can help me.
You can find the code here.
The problem is not your code, the problem is how you generate your .exe. Doing that with pygame is a real bitch, but with some hacking and google’ing you can do it.
This should get you started: http://pygame.org/wiki/Pygame2exe