battery art

This commit is contained in:
Altaezio
2026-02-26 18:31:40 +01:00
parent b3cd816a14
commit 34a8273063
17 changed files with 255 additions and 48 deletions

View File

@@ -3,7 +3,11 @@ class_name TruckRecharge
func _ready():
if region:
%Bolt.modulate = Color.WHITE if region.data.charges > 0 else Color.RED
update()
func update():
%EnergyTextContainer.modulate = Color.WHITE if region.data.charges > 0 else Color.RED
%EnergyText.text = str(region.data.charges)
func can_interact(_p : Player) -> bool:
return (
@@ -18,7 +22,7 @@ func interact(_p: Player) -> bool:
region.data.charges -= 1
region.pass_day()
%Bolt.modulate = Color.WHITE if region.data.charges > 0 else Color.RED
update()
return true
return false