Code: Select all
define boss = Character('Boss', color="#ffc8ff")
screen hidden_timer:
timer 5.0 action ui.jumps("boss_said_slow")
init:
python:
def countdown(st, at, length=0.0):
remaining = length - st
if remaining > 5.0:
return Text("%.1f" % remaining, color="#fff", size=72), .1
elif remaining > 0.0:
return Text("%.1f" % remaining, color="#f00", size=72), .1
else:
return anim.Blink(Text("0.0", color="#f00", size=72)), None
image countdown = DynamicDisplayable(countdown, length=5.0)
# The game starts here.
label start:
boss "Bomb will explode in 5.0... except you enter the password!"
call show_timer
$ password = ''
while (password != "password"):
$ password = renpy.input("Let's see. The password is...")
call hide_timer
boss "Good! you defuse it!"
return
label boss_said_slow:
if (run_timer == True):
call hide_timer
boss "BOMB! you are to slow!"
".: Game Over :."
return
label hide_timer:
$ run_timer = False
hide screen hidden_timer
hide countdown
with dissolve
return
label show_timer:
$ run_timer = True
show screen hidden_timer
show countdown at Position(xalign=.1, yalign=.1)
return