added basic scene manager

This commit is contained in:
Luca 2024-09-27 09:37:12 +02:00
parent f694d5c4f8
commit 2cf0846597
7 changed files with 37 additions and 57 deletions

View file

@ -28,7 +28,7 @@ var level: int = 1
var xp: int = 1
# the ID is the filename of the monster from res://resources/monsters/<filename>.tres
# the ID is the filename of the monster from res://entities/monsters/<filename>.tres
func set_data(p_unique_id = "", current_values: Dictionary = {}, p_level: int = 1) -> void:
if p_unique_id.is_empty():
printerr("Monster.gd: No ID given")
@ -59,7 +59,7 @@ func set_data(p_unique_id = "", current_values: Dictionary = {}, p_level: int =
func load_base_monster_data(p_unique_id):
var path = "res://resources/monsters/" + p_unique_id + ".tres"
if FileAccess.file_exists(path):
if ResourceLoader.exists(path):
var base_monster = load(path)
return base_monster