forked from team-sg/hero-mark-2
Nothing personnel, milliseconds...
This commit is contained in:
parent
b8d9a9e935
commit
314b365f7f
6 changed files with 23 additions and 10 deletions
|
@ -47,6 +47,7 @@ var is_easy_mode: bool = false # whether to do easy-specific behaviors
|
|||
var use_lives: bool = false
|
||||
var can_pause: bool = true
|
||||
var current_palette: String = "default"
|
||||
var still_playing: bool = false
|
||||
|
||||
|
||||
func _ready():
|
||||
|
@ -122,10 +123,10 @@ func tally_scores() -> void:
|
|||
shards_collected[6] = true
|
||||
# life bonus
|
||||
if deaths == 0:
|
||||
life_bonus = 500
|
||||
life_bonus = 1500
|
||||
shards_collected[7] = true
|
||||
elif deaths == 1:
|
||||
life_bonus = 1500
|
||||
life_bonus = 500
|
||||
# perfect bonus
|
||||
if shards_collected[5] and shards_collected[6] and shards_collected[7]:
|
||||
perfect_bonus += 1000
|
||||
|
@ -199,7 +200,7 @@ func save():
|
|||
Save.current_file.save_to_file()
|
||||
|
||||
|
||||
#Convert seconds into M:SS:MS
|
||||
# !!DEPRECATED!! convert milliseconds into M:SS:MS
|
||||
func timeify(input):
|
||||
if input <= 5999099:
|
||||
var seconds = fmod(Game.time / 1000,60)
|
||||
|
@ -211,6 +212,17 @@ func timeify(input):
|
|||
else:
|
||||
return "99:59.99"
|
||||
|
||||
# convert seconds into M:SS.MS
|
||||
func format_time(seconds: float) -> String:
|
||||
if is_inf(seconds) or is_nan(seconds): # infinite
|
||||
return "-:--.--"
|
||||
elif seconds >= 600.0: # 10 minutes or greater
|
||||
return "9:99.99"
|
||||
else:
|
||||
var minutes = floor(seconds / 60.0)
|
||||
var centiseconds = fmod(floor(seconds * 100.0), 100.0)
|
||||
return "%01d:%02d.%02d" % [minutes, fmod(seconds, 60.0), centiseconds]
|
||||
|
||||
#Restart level
|
||||
func restart_level():
|
||||
clear_collectibles()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue