diff --git a/README.md b/README.md index 7968b66..e3278a3 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,12 @@ You can simply execute the launcher.py file, or you can go into command prompt a `python launcher.py` +# How to Build + +An executable file can be built by using `pyinstaller`: + +`pyinstaller --add-data src;src --add-data sounds;sounds --add-data img;img --add-data sprites;sprites --add-data tilemap;tilemap --onefile launcher.py` + # Backstory The game is set in the middle of 22nd century, and the player flies a futuristic fighter craft called the R-9a "Arrowhead", named for its shape, and because it is the ninth model in the 'R' series of fighter craft (but it is the first of the series to actually be used in combat; the previous models were all prototypes). diff --git a/launcher.py b/launcher.py index 91f32da..82aa78f 100644 --- a/launcher.py +++ b/launcher.py @@ -5,6 +5,7 @@ Rick Miyamoto """ +import os import sys import pygame @@ -14,6 +15,9 @@ FPS = 60 +# A hack to get pyinstaller to work +if getattr(sys, 'frozen', False): + os.chdir(sys._MEIPASS) def main(): pygame.init()