✨ Ebb and flow
This commit is contained in:
6
scripts/ui/finish_screen.gd
Normal file
6
scripts/ui/finish_screen.gd
Normal file
@ -0,0 +1,6 @@
|
||||
extends Control
|
||||
|
||||
@export var stats: Statistics
|
||||
|
||||
func _show():
|
||||
visible = true
|
25
scripts/ui/stats_overlay.gd
Normal file
25
scripts/ui/stats_overlay.gd
Normal file
@ -0,0 +1,25 @@
|
||||
extends Control
|
||||
|
||||
@export var stats: Statistics
|
||||
|
||||
@export var survived_indicator: Label
|
||||
|
||||
@export var wave_indicator: Label
|
||||
@export var wave_progress: ProgressBar
|
||||
|
||||
var wave_stylebox = StyleBoxFlat.new()
|
||||
var wave_gap_stylebox = StyleBoxFlat.new()
|
||||
|
||||
func _ready():
|
||||
wave_stylebox.bg_color = Color("84ba7a")
|
||||
wave_gap_stylebox.bg_color = Color("89a1e5")
|
||||
|
||||
func _process(_delta):
|
||||
survived_indicator.text = "%.2fs" % (stats.get_time_survived() / 1000.0)
|
||||
wave_indicator.text = "%d" % stats.get_current_wave()
|
||||
|
||||
if stats.in_wave_gap:
|
||||
wave_progress.add_theme_stylebox_override("fill", wave_gap_stylebox)
|
||||
else:
|
||||
wave_progress.add_theme_stylebox_override("fill", wave_stylebox)
|
||||
wave_progress.value = stats.get_current_wave_time() / stats.get_current_wave_duration() * 100
|
Reference in New Issue
Block a user