I'd like you to still be able to play the rest of the game though while the time counts down in the background and even when the game is closed.
After 60 mins go by, the scene should be unlocked. Kinda like those texting simulator games. Is there a way to do this?
Here's what I've got so far:
This is a basic timer in which it restarts after clicking on a menu. I'd like a timer that doesn't restart every time I open a menu or even close the game. I'd like to have the timer running in the background until it's at zero and the reward is unlocked. I'd like the timer to restart after the old reward is claimed, and then you can then wait for the next reward in line to countdown.
Code: Select all
init:
python:
def countdown(st, at, length=0.0):
persistent.remaining = length - st
minutes = (int) (length - st) / 60
seconds = (int) (length - st) % 60
if persistent.remaining > 10.0:
return Text("%02d:" % minutes + "%02d" % seconds, color="#fff", size=48), .1
elif persistent.remaining > 0.0:
return Text("%02d:" % minutes + "%02d" % seconds, color="#f00", size=48), .1
else:
renpy.jump("reward")
label reward:
"Bob's back from the war."
bob"Thanks for waiting."
return