diff --git a/autoloads/game.gd b/autoloads/game.gd index edb499b..802249f 100644 --- a/autoloads/game.gd +++ b/autoloads/game.gd @@ -200,15 +200,15 @@ func save(): #Convert seconds into M:SS:MS func timeify(input): - if input < 600: - var minutes = str(floor(input / 60)) - var seconds = floor(fmod(input,60)) - var milliseconds := floor(fmod(input, 1) * 100) - return minutes + ":" + ("%02d" % seconds) + "." + ("%02d" % milliseconds) + if input <= 5999099: + var seconds = fmod(Game.time / 1000,60) + var minutes = floor((Game.time / 1000) / 60) + var centiseconds = fmod(floor(seconds * 100),100) + return ("%02d" % minutes) + ":" + ("%02d" % seconds) + "." + ("%02d" % centiseconds) elif input == INF: return "-:--.--" else: - return "9:59.99" + return "99:59.99" #Restart level func restart_level(): diff --git a/graphics/hud/hud.png b/graphics/hud/hud.png index 0374dce..a61d4b6 100644 Binary files a/graphics/hud/hud.png and b/graphics/hud/hud.png differ diff --git a/objects/hud/hud.gd b/objects/hud/hud.gd index 3b50fe4..1300211 100644 --- a/objects/hud/hud.gd +++ b/objects/hud/hud.gd @@ -14,12 +14,12 @@ onready var high_counter = $HighCounter onready var time_counter = $TimeCounter onready var oxygen = $Oxygen onready var oxygen_meter = $Oxygen/OxygenMeter +onready var start_time = Time.get_ticks_msec() export var song_name = "♫Music" export (Color) var bonus_color func _ready(): - Game.time = 0 #Change graphics depending on if lives are on if Game.use_lives: $LivesHead.visible = true @@ -75,7 +75,7 @@ func _physics_process(delta): else: lives_counter.modulate = Color.white ##Timer - Game.time += delta + Game.time = Time.get_ticks_msec() - start_time time_counter.text = Game.timeify(Game.time) #Time bonus counter if (Game.has_collection_bonus() && Game.time <= Game.get_map().target_time_100) or (!Game.has_collection_bonus() && Game.time <= Game.get_map().target_time_any): diff --git a/objects/hud/hud.tscn b/objects/hud/hud.tscn index b338003..6086026 100644 --- a/objects/hud/hud.tscn +++ b/objects/hud/hud.tscn @@ -152,7 +152,7 @@ margin_top = 181.0 margin_right = 50.0 margin_bottom = 191.0 theme = ExtResource( 10 ) -text = "0:00:00" +text = "00:00:00" [node name="Music" type="Label" parent="."] material = ExtResource( 8 )