Code: Select all
#BlackKeys
screen BlackKeys:
key "dismiss" action [[]]
frame:
xalign 0.5 yalign 0.5
vbox:
text "{b}Black Keys" at centre
text "Click in the message using the black piano keys."
text "Tip: There are 28 black keys and 28 letters of the alphabet."
textbutton "OK" action Hide("BlackKeys") at centre
null height 20
#put this before call game
$ a8 = False
$ d3 = False
$ d5 = False
$ d13 = False
$ e10 = False
$ e15 = False
$ h1 = False
$ h7 = False
$ i4 = False
$ i6 = False
$ i14 = False
$ o12 = False
$ t11 = False
$ v9 = False
$ w0 = False
$ y2 = False
screen Piano_Game:
$ renpy.block_rollback()
key "dismiss" action [[]]
imagemap:
ground "pianobase.png"
hover "pianobase0.png"
if a8 == True and d3 == True and d5 == True and d13 == True and e10 == True and h1 == True and h7 == True and i4 == True and i6 == True and i14 == True and o12 == True and t11 == True and v9 == True and w0 == True and y2 == True and e15 == True:
hotspot (474, 673, 97, 38) clicked Jump("finishgame")
else:
hotspot (21, 301, 23, 114) clicked Jump("a8")
hotspot (72, 299, 23, 114) clicked Jump("x")
hotspot (104, 300, 23, 114) clicked Jump("x")
hotspot (151, 299, 23, 114) clicked Jump("d3513")
hotspot (185, 300, 23, 114) clicked Jump("e1015")
hotspot (215, 298, 23, 114) clicked Jump("x")
hotspot (267, 298, 23, 114) clicked Jump("x")
hotspot (296, 298, 23, 114) clicked Jump("h17")
hotspot (346, 297, 23, 114) clicked Jump("i4614")
hotspot (377, 297, 23, 114) clicked Jump("x")
hotspot (411, 299, 23, 114) clicked Jump("x")
hotspot (458, 297, 23, 114) clicked Jump("x")
hotspot (491, 299, 23, 114) clicked Jump("x")
hotspot (541, 300, 23, 114) clicked Jump("x")
hotspot (571, 300, 23, 114) clicked Jump("o12")
hotspot (605, 299, 23, 114) clicked Jump("x")
hotspot (654, 298, 23, 114) clicked Jump("x")
hotspot (687, 299, 23, 114) clicked Jump("x")
hotspot (735, 299, 23, 114) clicked Jump("x")
hotspot (766, 299, 23, 114) clicked Jump("t11")
hotspot (798, 298, 23, 114) clicked Jump("x")
hotspot (847, 299, 23, 114) clicked Jump("v9")
hotspot (879, 299, 23, 114) clicked Jump("w0")
hotspot (929, 298, 23, 114) clicked Jump("x")
hotspot (959, 299, 23, 114) clicked Jump("y2")
hotspot (991, 300, 23, 114) clicked Jump("x")
label w0:
if a8 == False and d3 == False and d5 == False and d13 == False and e10 == False and e15 == False and h1 == False and h7 == False and i4 == False and i6 == False and i14 == False and o12 == False and t11 == False and v9 == False and y2 == False: #checked
$ w0 = True
scene pianobase
"W"
call screen Piano_Game
else:
scene pianobase
call screen Piano_Game
label h17:
if a8 == False and d3 == True and d5 == True and d13 == False and e10 == False and e15 == False and h1 == True and i4 == True and i6 == True and i14 == False and o12 == False and t11 == False and v9 == False and w0 ==True and y2 == True: #checked
$ h7 = True
scene pianobase
"Why did I h"
call screen Piano_Game
else:
if a8 == False and d3 == False and d5 == False and d13 == False and e10 == False and e15 == False and h7 == False and i4 == False and i6 == False and i14 == False and o12 == False and t11 == False and v9 == False and w0 == True and y2 == False: #checked
$ h1 = True
scene pianobase
"Wh"
call screen Piano_Game
else:
scene pianobase
call screen Piano_Game
label y2:
if a8 == False and d3 == False and d5 == False and d13 == False and e10 == False and e15 == False and h1 == True and h7 == False and i4 == False and i6 == False and i14 == False and o12 == False and t11 == False and v9 == False and w0 == True: #checked
$ y2 = True
scene pianobase
"Why"
call screen Piano_Game
else:
scene pianobase
call screen Piano_Game
label d3513:
if a8 == True and d3 == True and d5 == True and e10 == True and e15 == False and h1 == True and h7 == True and i4 == True and i6 == True and i14 == False and o12 == True and t11 == True and v9 == True and w0 == True and y2 == True: #checked
$ d13 = True
scene pianobase
"Why did I have to d"
call screen Piano_Game
else:
if a8 == False and d3 == True and d13 == False and e10 == False and e15 == False and h1 == True and h7 == False and i4 == True and i6 == False and i14 == True and o12 == False and t11 == False and v9 == False and w0 == True and y2 == True: #checked
$ d5 = True
scene pianobase
"Why did"
call screen Piano_Game
else:
if a8 == False and d5 == False and d13 == False and e10 == False and e15 == False and h1 == True and h7 == False and i4 == False and i6 == False and i14 == False and o12 == False and t11 == False and v9 == False and w0 == True and y2 == True: #checked
$ d3 = True
scene pianobase
"Why d"
call screen Piano_Game
else:
scene pianobase
call screen Piano_Game
label i4614:
if a8 == True and d3 == True and d5 == True and d13 == True and e10 == True and e15 == False and h1 == True and h7 == True and i4 == True and i6 == True and o12 == True and t11 == True and v9 == True and w0 == True and y2 == True: #checked
$ i14 = True
scene pianobase
"Why did I have to di"
call screen Piano_Game
else:
if a8 == False and d3 == True and d5 == True and d13 == False and e10 == False and e15 == False and h1 == True and h7 == False and i4 == True and i14 == False and o12 == False and t11 == False and v9 == False and w0 == True and y2 == True: #checked
$ i6 = True
scene pianobase
"Why did I"
call screen Piano_Game
else:
if a8 == False and d3 == True and d5 == False and d13 == False and e10 == False and e15 == False and h1 == True and h7 == False and i6 == False and i14 == False and o12 == False and t11 == False and v9 == False and w0 == True and y2 == True: #checked
$ i4 = True
scene pianobase
"Why di"
call screen Piano_Game
else:
scene pianobase
call screen Piano_Game
label a8:
if d3 == True and d5 == True and d13 == False and e10 == False and e15 == False and h1 == True and h7 == True and i4 == True and i6 == True and i14 == False and o12 == False and t11 == False and v9 == False and w0 ==True and y2 == True:
$ a8 = True
scene pianobase
"Why did I ha"
call screen Piano_Game
label v9:
if a8 == True and d3 == True and d5 == True and d13 == False and e10 == False and e15 == False and h1 == True and h7 == True and i4 == True and i6 == True and i14 == False and o12 == False and t11 == False and w0 ==True and y2 == True:
$ v9 = True
scene pianobase
"Why did I hav"
call screen Piano_Game
label e1015:
if a8 == True and d3 == True and d5 == True and d13 == True and e10 == True and h1 == True and h7 == True and i4 == True and i6 == True and i14 == True and o12 == True and t11 == True and v9 == True and w0 == True and y2 == True: #checked
$ e15 = True
scene pianobase
"Why did I have to die."
call screen Piano_Game
else:
if a8 == True and d3 == True and d5 == True and d13 == False and e15 == False and h1 == True and h7 == True and i4 == True and i6 == True and i14 == False and o12 == False and t11 == False and w0 ==True and y2 == True and v9 == True:
$ e10 = True
scene pianobase
"Why did I have"
else:
scene pianobase
call screen Piano_Game
label t11:
if a8 == True and d3 == True and d5 == True and d13 == False and e10 == True and e15 == False and h1 == True and h7 == True and i4 == True and i6 == True and i14 == False and o12 == False and w0 ==True and y2 == True and v9 == True:
$ t11 = True
scene pianobase
"Why did I have t"
call screen Piano_Game
else:
scene pianobase
call screen Piano_Game
label o12:
if a8 == True and d3 == True and d5 == True and d13 == False and e10 == True and e15 == False and h1 == True and h7 == True and i4 == True and i6 == True and i14 == False and w0 ==True and y2 == True and t11 == True and v9 == True:
$ o12 = True
scene pianobase
"Why did I have to"
call screen Piano_Game
label x:
scene pianobase
call screen Piano_Game
label finishgame:
"YAY FINALLY"
return
Basically, what happens is that it works find until the "d5" part. Am I doing something wrong with the if and else statement? Or am I using it wrongly...? Because it just refuses to go to $ d5 = True...
What i'm trying to do in my game is to have the player press a sequence of piano keys to unlock a code.
(But sometimes the player has to press one key more than once. "eg. Why did..." The player has to press 'd' more than once and I can't seem to get the if and else statement to work...)
Please help and thank you for reading this
P.S: Just ignore the #checked sign...It was for my reference, nothing important.