Hi all,
I have the following code:
var time_mult = 10000.0 #how fast time goes by
var second = 0
var minute = 0
var hour = 0
var day = 1
var month = 1
var year = 1
var paused = false
and
func _process(delta):
#work out the clock/time/date logic
if not paused:
second += delta * time_mult
if second >=60:
second = 0
minute += 1
if minute >= 60:
minute = 0
hour += 1
print("hour passed")
if hour >= 24:
hour = 0
day += 1
print("day passed")
get_node("/root/gameLevel/InfoBar/LabelDay").set_text(str(day))
if day >= 28:
day = 0
month += 1
get_node("/root/gameLevel/InfoBar/LabelMonth").set_text(str(month))
if month >= 12:
month = 0
year += 1
get_node("/root/gameLevel/InfoBar/LabelYear").set_text(str(year))
So I can change the var time_mult
and it speeds up the clock. Dramatically. But I can't get it to speed up enough. I can get it up to about where it is now (10000 times faster or there abouts) and the print statement for hour passed
only happens once a second.
I can lift the time_mult
to 100000000 and it never goes faster than once a second.
What am I doing incorrectly here? Why is it maxing out at that multiplier value?
Thanks so much...