Code: Select all
label codeAttempt1:
$ keyInputs1 = []
$ firstCode = True
show screen SafeCombination
python:
while len(keyInputs1) < len(keycode):
result = ui.interact()
if isinstance(result, int):
keyInputs1.append(result)
if keyInputs1 == keycode:
hide screen SafeCombination
play voice "door open close.mp3"
jump success
else:
hide screen SafeCombination
play voice "red alarm 2.mp3"
scene bg safeRedBulb
pause 1.5
jump alarm
label success:
scene bg safeGreenBulb
s "Another job well done, old girl."
################################################
label codeAttempt2:
scene bg office alarm
s "Argh... try to remember, Scottie."
$ hint1 = renpy.random.choice(["[keycode[0]]", "something"])
$ hint2 = renpy.random.choice(["[keycode[1]]", "something"])
$ hint3 = renpy.random.choice(["[keycode[2]]", "something"])
$ hint4 = renpy.random.choice(["[keycode[3]]", "something"])
s "The code was... "
extend "%(hint1)s, "
extend "%(hint2)s... "
extend "%(hint3)s "
extend "and then %(hint4)s."
s "Okay, let's take another stab at this."
scene bg Safe Alarmed
$ keyInputs2 = []
show screen SafeAlarm
python:
while len(keyInputs2) < len(keycode):
result = ui.interact()
if isinstance(result, int):
keyInputs2.append(result)
if keyInputs2 == keycode:
hide screen SafeAlarm
play voice "door open close.mp3"
jump successAlarm
else:
hide screen SafeAlarm
jump failAlarm
################################################
screen SafeCombination:
imagemap:
ground "WORLD/Safe.png"
hover "WORLD/SafeCombination Hover.png"
hotspot (508, 458, 57, 56) action [Play ("sound", "buttonpress.ogg"), Return(1)] #--> 1
hotspot (583, 460, 57, 56) action [Play ("sound", "buttonpress.ogg"), Return(2)] #--> 2
hotspot (661, 462, 57, 56) action [Play ("sound", "buttonpress.ogg"), Return(3)] #--> 3
hotspot (508, 531, 57, 56) action [Play ("sound", "buttonpress.ogg"), Return(4)] #--> 4
hotspot (583, 533, 57, 56) action [Play ("sound", "buttonpress.ogg"), Return(5)] #--> 5
hotspot (661, 535, 57, 56) action [Play ("sound", "buttonpress.ogg"), Return(6)] #--> 6
hotspot (508, 607, 57, 56) action [Play ("sound", "buttonpress.ogg"), Return(7)] #--> 7
hotspot (583, 607, 57, 56) action [Play ("sound", "buttonpress.ogg"), Return(8)] #--> 8
hotspot (661, 611, 57, 56) action [Play ("sound", "buttonpress.ogg"), Return(9)] #--> 9
screen SafeAlarm:
imagemap:
ground "WORLD/Safe Alarmed.png"
hover "WORLD/SafeCombination Hover.png"
hotspot (508, 458, 57, 56) action [Play ("sound", "buttonpress.ogg"), Return(1)] #--> 1
hotspot (583, 460, 57, 56) action [Play ("sound", "buttonpress.ogg"), Return(2)] #--> 2
hotspot (661, 462, 57, 56) action [Play ("sound", "buttonpress.ogg"), Return(3)] #--> 3
hotspot (508, 531, 57, 56) action [Play ("sound", "buttonpress.ogg"), Return(4)] #--> 4
hotspot (583, 533, 57, 56) action [Play ("sound", "buttonpress.ogg"), Return(5)] #--> 5
hotspot (661, 535, 57, 56) action [Play ("sound", "buttonpress.ogg"), Return(6)] #--> 6
hotspot (508, 607, 57, 56) action [Play ("sound", "buttonpress.ogg"), Return(7)] #--> 7
hotspot (583, 607, 57, 56) action [Play ("sound", "buttonpress.ogg"), Return(8)] #--> 8
hotspot (661, 611, 57, 56) action [Play ("sound", "buttonpress.ogg"), Return(9)] #--> 9