You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

score.gd 815B

1234567891011121314151617181920212223242526272829303132333435
  1. extends RichTextLabel
  2. @export var current_score = 0
  3. @export var current_second_score = 0
  4. @export var total_score = 0
  5. @export var prev_second_scores: Array
  6. @onready var score_per_second = $"../Score Per Second"
  7. @onready var narration = $"../Narration"
  8. # Called when the node enters the scene tree for the first time.
  9. func _ready():
  10. pass # Replace with function body.
  11. # Called every frame. 'delta' is the elapsed time since the previous frame.
  12. func _process(delta):
  13. pass
  14. func update(score):
  15. if score >= 0:
  16. current_second_score += score
  17. current_score += score
  18. total_score += score
  19. update_text(current_score)
  20. func update_text(score_num):
  21. text = "Energy: " + str(current_score)
  22. func _on_interface_ready():
  23. pass # Replace with function body.
  24. func _on_score_update(click_value):
  25. update(click_value)