diff options
author | bd <bdunahu@operationnull.com> | 2025-05-22 13:50:49 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-05-22 13:50:49 -0400 |
commit | 8c5c4863aeacb4afcf70f339df6d601e2df1a7a6 (patch) | |
tree | 6c2af54a18271534864a7a1daed7814ebac5abd1 /scenes/crawlers/soldier.gd | |
parent | 80e145ba2b85e08f895e76ba6a03bb67bc9ce9ea (diff) |
Reorganized files into scenes and scripts
Diffstat (limited to 'scenes/crawlers/soldier.gd')
-rw-r--r-- | scenes/crawlers/soldier.gd | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/scenes/crawlers/soldier.gd b/scenes/crawlers/soldier.gd deleted file mode 100644 index fe494e6..0000000 --- a/scenes/crawlers/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(damage): - _health -= 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 |