I would suggest using --onefile
argument also. Since your game contains images and audio files the most probable problem is that you have not moved your .exe
from dist folder to the folder where is your main.py
so the paths to those images and audio files are incorrect. And if you have not already, update pygame to 2.0.0.dev6
or dev8
, because from personal experience pygame 1.9.6
in certain cases cause error when audio files are present. These steps should solve the issue.
EDIT: Answer on comment
Oh, I did not know that you used font. 2 possible fixes, had the same issue. First use some "standard" fonts like "Arial".
font = pg.font.SysFont("Arial", FONT_SIZE, True)
or put the font you want to use (freesansbold.ttf
) in the same folder as .exe
First option will work for sure.