|
|
|
|
@ -19,11 +19,12 @@ const BOSS = preload("res://scenes/boss.tscn")
|
|
|
|
|
@export var tree_density := 100000
|
|
|
|
|
|
|
|
|
|
# Import the GameData and UIData classes
|
|
|
|
|
const GameData = preload("res://scripts/game_data.gd")
|
|
|
|
|
const UIData = preload("res://scripts/ui_data.gd")
|
|
|
|
|
const GameDataResource = preload("res://scripts/game_data.gd")
|
|
|
|
|
const UIDataResource = preload("res://scripts/ui_data.gd")
|
|
|
|
|
const MobDataResource = preload("res://scripts/mob_data.gd")
|
|
|
|
|
|
|
|
|
|
var game_data = GameData.new(0, 3, 1, 3, 0)
|
|
|
|
|
var ui_data = UIData.new(0, 3, 1, 3, 0)
|
|
|
|
|
var game_data = GameDataResource.new(0, 3, 1, 3, 0)
|
|
|
|
|
var ui_data = UIDataResource.new(0, 3, 1, 3, 0)
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
|
|
|
|
background_color.size = map_size
|
|
|
|
|
@ -81,11 +82,12 @@ func _on_mob_died(mob_xp: int) -> void:
|
|
|
|
|
func spawn_boss() -> void:
|
|
|
|
|
print("Spawn Boss")
|
|
|
|
|
var new_boss = BOSS.instantiate()
|
|
|
|
|
new_boss.mob_data = MobDataResource.new(10, 50, 20)
|
|
|
|
|
path_follow_2d.progress_ratio = randf()
|
|
|
|
|
new_boss.global_position = path_follow_2d.global_position
|
|
|
|
|
new_boss.connect("mob_died", Callable(self, "_on_mob_died"))
|
|
|
|
|
add_child(new_boss)
|
|
|
|
|
|
|
|
|
|
func _on_level_up() -> void:
|
|
|
|
|
spawn_mob_timer.wait_time = 1 - (game_data.level * 0.1)
|
|
|
|
|
# spawn_mob_timer.wait_time = 1 - (game_data.level * 0.1)
|
|
|
|
|
level_up.emit(game_data.level)
|
|
|
|
|
|