mirror of
https://github.com/csd4ni3l/game-of-life.git
synced 2026-01-01 04:23:42 +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 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"))
|
# Get the directory where this module is located
|
||||||
button_hovered_texture = arcade.gui.NinePatchTexture(64 // 4, 64 // 4, 64 // 4, 64 // 4, arcade.load_texture("assets/graphics/button_hovered.png"))
|
_module_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
cursor_texture = arcade.load_texture("assets/graphics/cursor.png")
|
_assets_dir = os.path.join(os.path.dirname(_module_dir), 'assets')
|
||||||
|
|
||||||
create_sound = arcade.Sound("assets/sound/create.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')))
|
||||||
destroy_sound = arcade.Sound("assets/sound/destroy.mp3")
|
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')))
|
||||||
theme_sound = arcade.Sound("assets/sound/music.mp3")
|
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