diff options
author | bd <bdunahu@operationnull.com> | 2025-05-23 11:44:21 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-05-23 11:44:21 -0400 |
commit | a677a3e8ed63241e7931265941d562284a15d16a (patch) | |
tree | 265c3f353525ae462236417298ff7f0f272870e1 /scripts/soldier.gd | |
parent | bc3589db94692fc4cdd4388dacff0f44fe8a2030 (diff) |
Move enemy logic to base_crawler, add crawler flip animation
Diffstat (limited to 'scripts/soldier.gd')
-rw-r--r-- | scripts/soldier.gd | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/scripts/soldier.gd b/scripts/soldier.gd deleted file mode 100644 index d373237..0000000 --- a/scripts/soldier.gd +++ /dev/null @@ -1,27 +0,0 @@ -extends CharacterBody2D - -@export var worth : int = 5 -@export var damage : int = 1 -@export var speed : float = 50.0 -@export var max_health : float = 30.0 -var _health : float = max_health - -func _process(delta): - get_parent().set_progress(get_parent().get_progress() + speed * delta) - if get_parent().get_progress_ratio() == 1: - GameData.subtract_morale(damage) - queue_free() - -func deal_damage(tower_damage): - _health -= tower_damage - if _health <= 0: - GameData.add_life(worth) - queue_free() - else: - _update_color() - -func _update_color(): - var ratio : float = _health / max_health - var target_color = Color(1, ratio, ratio) - - $Sprite2D.modulate = target_color |