diff options
author | jacopograndi <jacopo.grandi@outlook.it> | 2022-02-08 11:24:51 +0100 |
---|---|---|
committer | jacopograndi <jacopo.grandi@outlook.it> | 2022-02-08 11:24:51 +0100 |
commit | eea642395bb0ef706c7241d4a749f3e0ac4cc460 (patch) | |
tree | 6c015c9315b0102247661f942b018ccf8c45551d /scripts/enemies.gd | |
parent | e8b2ea6b2bf789b7942d86faebbcc4d810741f25 (diff) |
revised wave generation
Diffstat (limited to 'scripts/enemies.gd')
-rw-r--r-- | scripts/enemies.gd | 5 |
1 files changed, 3 insertions, 2 deletions
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, |