school-game/godot/BudgetMenu.gd

20 lines
688 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")
@onready var finances = get_node("/root/Finances")
2022-11-09 12:09:17 +00:00
var estimate_month
# Called when the node enters the scene tree for the first time.
func _ready():
game_time.connect("heartbeat", Callable(self, "_on_heartbeat"))
2022-11-09 12:09:17 +00:00
func _on_heartbeat():
estimate_month = player_vars.pupils_income - player_vars.operating_costs - player_vars.salary_cost
$BuildingCostNumber.text = str(player_vars.operating_costs)
$TeacherCostNumber.text = str(player_vars.salary_cost)
$PupilIncomeNumber.text = str(player_vars.pupils_income)
$TotalNumber.text = str(estimate_month)