Tough_Crowd/godot/scenes/DisplayMood.gd

18 lines
426 B
GDScript3
Raw Normal View History

2024-01-27 18:33:33 +00:00
extends Label
var audience: Array[AudienceMember] = []
2024-01-27 18:33:33 +00:00
# Called when the node enters the scene tree for the first time.
func _ready():
for seat in get_node("/root/IngameScene/Crowd/Seats").get_children():
audience.append(seat.get_node("Person"))
2024-01-27 18:33:33 +00:00
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
var mood = 0
for m in audience:
mood += m.mood
text = str(int(mood))