diff --git a/build.bat b/build.bat index 3ff3c1d..b868451 100644 --- a/build.bat +++ b/build.bat @@ -1 +1 @@ -pyinstaller --add-data ./resources;resources --upx-dir "C:\Program Files\upx-3.96-win64" -w -F main.py \ No newline at end of file +pyinstaller --add-data ./resources;resources -i ./resources/icon.ico --upx-dir "C:\Program Files\upx-3.96-win64" -w -F main.py \ No newline at end of file diff --git a/main.py b/main.py index 5f7a65f..ffbfb56 100644 --- a/main.py +++ b/main.py @@ -39,6 +39,14 @@ # length of game. it should be from 1 to 10 max_input_char = 4 +def resource_path(relative_path): + # need to package a really single file + try: + base_path = sys._MEIPASS + except Exception: + base_path = os.path.abspath(".") + + return os.path.join(base_path, relative_path) # set many things global cows, bulls, step, l_result, l_gueesp, gueesp @@ -51,17 +59,6 @@ pr.init_physics() pr.set_target_fps(SET_FPS) # why i only now write it?... set target frame per seconds - -def resource_path(relative_path): - # need to package a really single file - try: - base_path = sys._MEIPASS - except Exception: - base_path = os.path.abspath(".") - - return os.path.join(base_path, relative_path) - - font: Font = pr.load_font(resource_path("resources/unifont.fnt")) # DON'T WRITE IT ON MAIN LOOP AND DON'T LOAD IT FIRST! seven_font: Font = pr.load_font_ex('C:/Windows/Fonts/calibril.ttf', 16, [int(1 + i) for i in range(0, 1206)], 1206) moonpng = pr.load_texture(resource_path('resources/moon.png')) @@ -74,6 +71,8 @@ def resource_path(relative_path): mutetex = pr.load_texture(resource_path('resources/mute.png')) mutedtex = pr.load_texture(resource_path('resources/muted.png')) backbtntex = pr.load_texture(resource_path('resources/backbtn.png')) +icontex = pr.load_image(resource_path('resources/icon.png')) +pr.set_window_icon(icontex) the_page_is = 0 the_heit_is = 190 about_origin = pr.Vector2(12, 82) diff --git a/resources/icon.ico b/resources/icon.ico new file mode 100644 index 0000000..1292f97 Binary files /dev/null and b/resources/icon.ico differ diff --git a/resources/icon.png b/resources/icon.png new file mode 100644 index 0000000..4bc9485 Binary files /dev/null and b/resources/icon.png differ