Re: Leave the Room [puzzle][escape]
Posted: Sun Apr 08, 2012 7:14 pm
I really liked the light puzzles. If it isn't too much of an imposition I would like a tutorial on how that is made.
Supporting creators of visual novels and story-based games since 2003.
https://lemmasoft.renai.us/forums/
https://lemmasoft.renai.us/forums/viewtopic.php?f=11&t=13978
Code: Select all
label start:
$ lightpositions = [[b, b, b, b, b],
[b, b, b, b, b],
[b, b, b, b, b],
[b, b, b, b, b],
[b, b, b, b, b]]
$ position = []
label lightchange:
$ lightposition[position[0]][position[1]] = position[2]
if lightposition == [[b, b, b, b, b],
[b, w, b, w, b],
[b, w, b, w, b],
[w, b, b, b, w],
[b, w, w, w, b]]:
jump win
else:
jump LabelForShowingPuzzle
screen lightpuzzle:
for a in range(len(lightpositions)):
for b in range(len(lightpositions[a])):
if lightposition[a][b] == "w":
imagebutton:
idle "lightw.png"
hover "lightw.png"
action [SetVariable('position', [a, b, 'b']), Jump('lightchange')]
xpos (b * WIDTH) ypos (a * HEIGHT)
if lightposition[a][b] == "b":
imagebutton:
idle "lightb.png"
hover "lightb.png"
action [SetVariable('position', [a, b, 'w']), Jump('lightchange')]
xpos (b * WIDTH) ypos (a * HEIGHT)