chocolate_gauge.gd 334 B

123456789101112131415
  1. class_name ChocolateGauge
  2. extends PanelContainer
  3. var chocolate_count := 0
  4. @onready var chocolateCounter: Label = %ChocolateCounter
  5. func increment_chocolate(count: int) -> void:
  6. chocolate_count += count
  7. chocolateCounter.set_text(str(chocolate_count))
  8. func _on_main_walker_chocolate_collected() -> void:
  9. increment_chocolate(1)