Done refactoring

This commit is contained in:
2ndbeam 2023-11-05 21:51:47 +03:00
commit 2176e9d798
88 changed files with 821 additions and 880 deletions

19
scripts/misc/Counter.gd Normal file
View file

@ -0,0 +1,19 @@
extends Label
@export var counter_id : String
@onready var ship = $"../../.."
@onready var hull = $"../../../Hull"
@onready var shield = $"../../../Shield"
func _process(_delta) -> void:
match counter_id:
"ammo":
text = str(hull.ammunition)
"fuel":
text = "Fuel: {fuel} / {max} units".format({"fuel":hull.fuel, "max":hull.max_fuel})
"hp":
text = "Hull Strength: {hp} / {max} units".format({"hp":"%0.2f" % hull.hp, "max":hull.max_hp})
"money":
text = "Available Money: {money} units".format({"money":ship.money})
"shield":
text = "Shield Capacity: {shield} / {max} units".format({"shield":"%0.2f" % shield.capacity, "max":shield.max_capacity})