forked from team-sg/hero-mark-2
fixed shmeconds
This commit is contained in:
parent
245abf90f3
commit
259fc5ce76
4 changed files with 9 additions and 9 deletions
|
@ -200,15 +200,15 @@ func save():
|
||||||
|
|
||||||
#Convert seconds into M:SS:MS
|
#Convert seconds into M:SS:MS
|
||||||
func timeify(input):
|
func timeify(input):
|
||||||
if input < 600:
|
if input <= 5999099:
|
||||||
var minutes = str(floor(input / 60))
|
var seconds = fmod(Game.time / 1000,60)
|
||||||
var seconds = floor(fmod(input,60))
|
var minutes = floor((Game.time / 1000) / 60)
|
||||||
var milliseconds := floor(fmod(input, 1) * 100)
|
var centiseconds = fmod(floor(seconds * 100),100)
|
||||||
return minutes + ":" + ("%02d" % seconds) + "." + ("%02d" % milliseconds)
|
return ("%02d" % minutes) + ":" + ("%02d" % seconds) + "." + ("%02d" % centiseconds)
|
||||||
elif input == INF:
|
elif input == INF:
|
||||||
return "-:--.--"
|
return "-:--.--"
|
||||||
else:
|
else:
|
||||||
return "9:59.99"
|
return "99:59.99"
|
||||||
|
|
||||||
#Restart level
|
#Restart level
|
||||||
func restart_level():
|
func restart_level():
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 615 B After Width: | Height: | Size: 615 B |
|
@ -14,12 +14,12 @@ onready var high_counter = $HighCounter
|
||||||
onready var time_counter = $TimeCounter
|
onready var time_counter = $TimeCounter
|
||||||
onready var oxygen = $Oxygen
|
onready var oxygen = $Oxygen
|
||||||
onready var oxygen_meter = $Oxygen/OxygenMeter
|
onready var oxygen_meter = $Oxygen/OxygenMeter
|
||||||
|
onready var start_time = Time.get_ticks_msec()
|
||||||
|
|
||||||
export var song_name = "♫Music"
|
export var song_name = "♫Music"
|
||||||
export (Color) var bonus_color
|
export (Color) var bonus_color
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
Game.time = 0
|
|
||||||
#Change graphics depending on if lives are on
|
#Change graphics depending on if lives are on
|
||||||
if Game.use_lives:
|
if Game.use_lives:
|
||||||
$LivesHead.visible = true
|
$LivesHead.visible = true
|
||||||
|
@ -75,7 +75,7 @@ func _physics_process(delta):
|
||||||
else:
|
else:
|
||||||
lives_counter.modulate = Color.white
|
lives_counter.modulate = Color.white
|
||||||
##Timer
|
##Timer
|
||||||
Game.time += delta
|
Game.time = Time.get_ticks_msec() - start_time
|
||||||
time_counter.text = Game.timeify(Game.time)
|
time_counter.text = Game.timeify(Game.time)
|
||||||
#Time bonus counter
|
#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):
|
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):
|
||||||
|
|
|
@ -152,7 +152,7 @@ margin_top = 181.0
|
||||||
margin_right = 50.0
|
margin_right = 50.0
|
||||||
margin_bottom = 191.0
|
margin_bottom = 191.0
|
||||||
theme = ExtResource( 10 )
|
theme = ExtResource( 10 )
|
||||||
text = "0:00:00"
|
text = "00:00:00"
|
||||||
|
|
||||||
[node name="Music" type="Label" parent="."]
|
[node name="Music" type="Label" parent="."]
|
||||||
material = ExtResource( 8 )
|
material = ExtResource( 8 )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue