Advertisement

Having problems converting my game to exe

Started by July 23, 2017 06:05 AM
3 comments, last by foolz887 7 years, 3 months ago

My game is in python using pygame.  It has a lot of images and sounds. With multible scripts.  I tried to use pyinstaller but it failed.  Not up to date with python 3.6.  Is there anything better other than Fx_freeze.  I'm having trouble understanding there docs..

  I would really like to add my game to some sites and I'm told converting the game to a exe is my best bet

In the past, I've used both py2exe and cx_freeze for Python/Pygame games. Both have worked, in terms of making a working executable.

I don't remember the exact syntax to make them work, but I know that both of those will work.

The end result isn't an indtaller, though; it's simply a copy of your directories/scripts/game files, with an executable binary file to launch the game. From there, you still have to "package" the game (for "packaging", I would always just zip or tar.bz2; I never made a proper "installer")

Advertisement

Thank you masskonfuzion,  I tried cx_freeze with tutorials last night along with trying to make a bat file to play it and both were unsuccessful. 

   does anyone know of some better examples of use.   all the examples  and tutorials I can find are all with little games.  mostly or all one script and one or two image files.  I have nearly 100 images and about 20 sound files...

  here is my script for my cx_freese *

-----------------------------------------------

from cx_Freeze import setup, Executable
setup(
 name = "spaceshooterREMASTEDgame",
 version = "0.1",
 description  = "classic space shooter",
 executables = [Executable(spaceshooterREMASTEDgame.py)])
---------------------------------------------------------------------
NameError: name 'spaceshooterREMASTEDgame' is not defined  <-----this is the error I get in my command window when attempting to build the setup.py file

I fixed this problem by copying the file cxfreeze-quickstart and pasted it in the file with my main script.  Then I ran it in my bash hub.

Made me a perfectly good setup.py script.  ran that (python setup.py build).  Then after the build folder was complete I pasted the images and sound files into the same build folder...and.....a working executable 

This topic is closed to new replies.

Advertisement