This repository has been archived on 2025-09-12. You can view files and clone it, but cannot push or open issues or pull requests.
slavic-game-jam-2020/functional/Robot.gd

19 lines
454 B
GDScript

extends RigidBody
var debug_label: Label
var charge: float = 0.5
# Called when the node enters the scene tree for the first time.
func _ready():
debug_label = get_tree().root.find_node("DebugLabel", true, false)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if debug_label:
debug_label.text = String(charge)
func add_charge(amount: float):
charge += amount
charge = clamp(charge, 0.0, 1.0)