mirror of
https://github.com/csd4ni3l/game-of-life.git
synced 2025-11-05 02:58:03 +01:00
Changed preload.py to use absolute paths for onefile
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
import arcade.gui, arcade
|
||||
import os
|
||||
|
||||
button_texture = arcade.gui.NinePatchTexture(64 // 4, 64 // 4, 64 // 4, 64 // 4, arcade.load_texture("assets/graphics/button.png"))
|
||||
button_hovered_texture = arcade.gui.NinePatchTexture(64 // 4, 64 // 4, 64 // 4, 64 // 4, arcade.load_texture("assets/graphics/button_hovered.png"))
|
||||
cursor_texture = arcade.load_texture("assets/graphics/cursor.png")
|
||||
# Get the directory where this module is located
|
||||
_module_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
_assets_dir = os.path.join(os.path.dirname(_module_dir), 'assets')
|
||||
|
||||
create_sound = arcade.Sound("assets/sound/create.mp3")
|
||||
destroy_sound = arcade.Sound("assets/sound/destroy.mp3")
|
||||
theme_sound = arcade.Sound("assets/sound/music.mp3")
|
||||
button_texture = arcade.gui.NinePatchTexture(64 // 4, 64 // 4, 64 // 4, 64 // 4, arcade.load_texture(os.path.join(_assets_dir, 'graphics', 'button.png')))
|
||||
button_hovered_texture = arcade.gui.NinePatchTexture(64 // 4, 64 // 4, 64 // 4, 64 // 4, arcade.load_texture(os.path.join(_assets_dir, 'graphics', 'button_hovered.png')))
|
||||
cursor_texture = arcade.load_texture(os.path.join(_assets_dir, 'graphics', 'cursor.png'))
|
||||
|
||||
create_sound = arcade.Sound(os.path.join(_assets_dir, 'sound', 'create.mp3'))
|
||||
destroy_sound = arcade.Sound(os.path.join(_assets_dir, 'sound', 'destroy.mp3'))
|
||||
theme_sound = arcade.Sound(os.path.join(_assets_dir, 'sound', 'music.mp3'))
|
||||
Reference in New Issue
Block a user