- Introduced explicit typing to variables and functions across multiple scripts for better code clarity. - Specified 'void' as the return type for functions that do not return a value. - Removed redundant code in some scripts.
26 lines
No EOL
837 B
GDScript
26 lines
No EOL
837 B
GDScript
extends Control
|
|
|
|
@onready var time_label : Label = get_node("%TimeSpent")
|
|
@onready var drones_label : Label = get_node("%DronesUsed")
|
|
@onready var points_label : Label = get_node("%TotalPoints")
|
|
|
|
@onready var main_menu_button : Button = get_node("%MainMenu")
|
|
|
|
func _ready() -> void:
|
|
visible = false
|
|
|
|
main_menu_button.connect("pressed", Callable(self, "on_main_menu_pressed"))
|
|
|
|
func _process(_delta : float) -> void:
|
|
if GameState.level_complete == true:
|
|
update_points()
|
|
visible = true
|
|
|
|
func update_points() -> void:
|
|
time_label.text = "Time Spent: " + Str.seconds_to_hms(GameState.level_timer)
|
|
drones_label.text = "Drones Used: " + str(GameState.drones_used)
|
|
points_label.text = "Total Points: " + Str.format_number(GameState.level_points)
|
|
|
|
func on_main_menu_pressed() -> void:
|
|
GameState.reset()
|
|
SceneMgr.load_scene("MAINMENU") |