I don't have any previous experience in using pygame, but by following an online tutorial I managed to create a Flappy Bird game. I want to turn the script into an .exe file to share with my friends. I created a setup.py file like this:
import cx_Freeze
import os
executables = [cx_Freeze.Executable("script.py")]
assets = ['res/assets/' + each for each in os.listdir('C:/Users/MehmetSanisoglu/Desktop/Game/res/assets')]
sounds = ['res/sound/' + each for each in os.listdir('C:/Users/MehmetSanisoglu/Desktop/Game/res/sound')]
files = assets + sounds
files.append('res/04B_19.TTF') #Add the font file
cx_Freeze.setup(
name="Flappy",
options={"build_exe": {"packages":['pygame','sys','random'],
"include_files":files}},
executables = executables
)
When I run cmd in the directory where script.py and setup.py are in it builds, however, in the created build file I can't find a "Flappy.exe", but there is one "script.exe". When I run script.exe it opens up a command line for a split second in which I could see the following lines:
running build
running build_exe
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
and then nothing happens. Can you help me out? Thanks