battery art
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user