# IT-Karro 2019

extends Label

#func _on_Timer_level():
	#var sec_elapsed = 0
	#sec_elapsed += 1
	#var seconds = sec_elapsed % 60
	#var minutes = sec_elapsed % 3600 / 60
	#var str_elapsed = "%02d : %02d" % [minutes, seconds]
	#get_node("../Timer").set_text(str(str_elapsed))
	
var time_start = 0
var time_now = 0

func _ready():
    time_start = OS.get_unix_time()
    set_process(true)

func _process(delta):
    time_now = OS.get_unix_time()
    var elapsed = time_now - time_start
    var minutes = elapsed / 60
    var seconds = elapsed % 60
    var str_elapsed = "%02d : %02d" % [minutes, seconds]
    # Save Timer Score
    #var f = File.new()
    #f.open("user://timerscore", File.WRITE)
    #f.store_var(str_elapsed)
    get_node("../Add_Time").set_text(str(str_elapsed))
