diff options
author | bd <bdunahu@operationnull.com> | 2025-05-21 20:45:06 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-05-21 20:45:06 -0400 |
commit | 80e145ba2b85e08f895e76ba6a03bb67bc9ce9ea (patch) | |
tree | ff5f15bedd718d0cfc9daf2963dcf8b3fec88e69 /scenes/game_data | |
parent | a00b14bcf2084a1e68f57620e27956813d469aad (diff) |
Add basic UI, morale / life logic
Diffstat (limited to 'scenes/game_data')
-rw-r--r-- | scenes/game_data/game_data.gd | 29 | ||||
-rw-r--r-- | scenes/game_data/game_data.gd.uid | 1 |
2 files changed, 30 insertions, 0 deletions
diff --git a/scenes/game_data/game_data.gd b/scenes/game_data/game_data.gd new file mode 100644 index 0000000..fd6a80e --- /dev/null +++ b/scenes/game_data/game_data.gd @@ -0,0 +1,29 @@ + +extends Node + +signal life_changed +signal morale_changed +var _life: int = 20 +var _morale: int = 10 + +func get_life() -> int: + return _life + +func add_life(amount: int): + _life += amount + emit_signal("life_changed", _life) + +func subtract_life(amount: int): + _life -= amount + emit_signal("life_changed", _life) + +func get_morale() -> int: + return _morale + +func add_morale(amount: int): + _morale += amount + emit_signal("morale_changed", _morale) + +func subtract_morale(amount: int): + _morale -= amount + emit_signal("life_changed", _morale) diff --git a/scenes/game_data/game_data.gd.uid b/scenes/game_data/game_data.gd.uid new file mode 100644 index 0000000..2c1f11b --- /dev/null +++ b/scenes/game_data/game_data.gd.uid @@ -0,0 +1 @@ +uid://c72ko8skbqiq5 |