From eea642395bb0ef706c7241d4a749f3e0ac4cc460 Mon Sep 17 00:00:00 2001 From: jacopograndi Date: Tue, 8 Feb 2022 11:24:51 +0100 Subject: revised wave generation --- scripts/enemies.gd | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts/enemies.gd') diff --git a/scripts/enemies.gd b/scripts/enemies.gd index a0f4416..3e8276d 100644 --- a/scripts/enemies.gd +++ b/scripts/enemies.gd @@ -45,13 +45,14 @@ func _ready(): load_shapes = saveload.get_node("load_shapes") if !load_shapes.loaded: yield(load_shapes, "done_loading") -func spawn(name, node_cur=0, rel_pos=0): +func spawn(name, node_cur=0, rel_pos=0, hp=0): print("spawned " + name) var instance = _enemy_blue.instance() add_child(instance) instance.transform.origin = _path.nodes[0].transform.origin; instance.name = str(serial_enemy) var info = load_shapes.info[name] + if hp == 0: hp = info.lives var instance_model = load_shapes.models[info.model_name].instance() instance.add_child(instance_model) @@ -60,7 +61,7 @@ func spawn(name, node_cur=0, rel_pos=0): var axis : Vector3 = Quat(Vector3(0, randf()*TAU, 0)) * Vector3.RIGHT enemies[serial_enemy] = { "name": name, - "hp": info.lives, + "hp": hp, "slow_effect": 0, "slow_time": 0, "cur": node_cur, -- cgit v1.2.3-54-g00ecf