school-game/godot/DebugMenu.gd

23 lines
650 B
GDScript3
Raw Normal View History

2022-11-09 12:09:17 +00:00
extends Control
@onready var player_vars = get_node("/root/PlayerVariables")
@onready var game_time = get_node("/root/GameTimer")
2022-11-09 12:09:17 +00:00
func _ready():
game_time.connect("heartbeat", Callable(self, "_on_heartbeat"))
2022-11-09 12:09:17 +00:00
func _on_heartbeat():
$PupilsLabel.text = str(player_vars.pupil_pop)
$TeacherLabel.text = str(player_vars.teacher_pop)
$ClassroomLabel.text = str(player_vars.classroom_count)
if player_vars.has_cpdroom == true:
$CPDRoomLabel.text = str("HasCPDRoom")
func _on_AddMoney_pressed():
player_vars.funds += 100000
func _on_StaffroomButton_pressed():
if player_vars.has_staffroom == true:
$StaffroomLabel.text = str("HasStaffroom")