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 /scripts/life.gd | |
parent | 80e145ba2b85e08f895e76ba6a03bb67bc9ce9ea (diff) |
Reorganized files into scenes and scripts
Diffstat (limited to 'scripts/life.gd')
-rw-r--r-- | scripts/life.gd | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/life.gd b/scripts/life.gd new file mode 100644 index 0000000..b185cda --- /dev/null +++ b/scripts/life.gd @@ -0,0 +1,11 @@ +extends Label + +func _ready(): + GameData.connect("life_changed", Callable(self, "_on_life_changed")) + update_label(GameData.get_life()) + +func _on_life_changed(new_life: int) -> void: + update_label(new_life) + +func update_label(new_life: int) -> void: + text = "Life:" + str(new_life) |