gotta go fast, hit that BLJgit status
This commit is contained in:
parent
b54e9272c6
commit
32189c29a4
10 changed files with 115 additions and 6 deletions
28
autoloads/speedrun_timer.gd
Normal file
28
autoloads/speedrun_timer.gd
Normal file
|
@ -0,0 +1,28 @@
|
|||
extends CanvasLayer
|
||||
|
||||
|
||||
export var bonus_color: Color
|
||||
|
||||
|
||||
var time: float = 0.0
|
||||
var timer_running: bool = false
|
||||
|
||||
|
||||
onready var time_counter: Label = $Box/TimeCounter
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if timer_running:
|
||||
time += delta
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if visible:
|
||||
time_counter.text = Game.format_time(time)
|
||||
|
||||
var map = Game.get_map()
|
||||
if is_instance_valid(map):
|
||||
if (Game.has_collection_bonus() && Game.time <= map.target_time_100) or (!Game.has_collection_bonus() && Game.time <= map.target_time_any):
|
||||
time_counter.modulate = bonus_color
|
||||
return
|
||||
time_counter.modulate = Color.white
|
Loading…
Add table
Add a link
Reference in a new issue