home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- global Percorso, Psuoni, Macchina, Nfile, num, grandezza, segno, voce, Lingua
- set voce to Lingua & 0
- voce()
- nascondi()
- NASCONDIPUZZLE()
- updateStage()
- go("luce1")
- set Percorso to the pathName
- set Psuoni to Percorso & "Snd" & segno
- set grandezza to 0
- end
-
- on stopMovie
- global msprite
- set msprite to 0
- end
-
- on pigia
- global Psuoni
- sound playFile 2, Psuoni & "click.aif"
- end
-
- on Sbagliato
- global Psuoni
- sound playFile 2, Psuoni & "nyuk1.aif"
- end
-
- on giusto
- global Psuoni, Lingua, segno
- if Lingua = 0 then
- sound playFile 2, Psuoni & "alleluj2.aif"
- else
- sound playFile 2, Psuoni & "ing" & segno & "alleluj2.aif"
- end if
- end
-
- on nascondi
- repeat with n = 2 to 7
- set the visible of sprite n to 0
- end repeat
- set the visible of sprite 11 to 0
- updateStage()
- end
-
- on NASCONDIPUZZLE
- repeat with n = 12 to 48
- set the visible of sprite n to 0
- end repeat
- updateStage()
- end
-
- on pulsante
- global altezza, larghezza, grandezza
- if the stillDown then
- if (larghezza > 0) and (larghezza < 87) and (altezza > 0) and (altezza < 140) then
- set the visible of sprite 5 to 1
- updateStage()
- end if
- else
- set the visible of sprite 5 to 0
- end if
- end
-
- on Crealista1
- global listapuzzle, soluzione, qq
- set aggiungi to 1
- set listapuzzle to list()
- set x to random(9) + 30 + ((qq - 1) * 60)
- set dim to 1
- addAt(listapuzzle, 1, x)
- repeat while dim < 9
- set x to random(9) + 30 + ((qq - 1) * 60)
- repeat with j = 1 to dim
- if x = getAt(listapuzzle, j) then
- set aggiungi to 0
- end if
- end repeat
- if aggiungi then
- append(listapuzzle, x)
- set dim to dim + 1
- end if
- set aggiungi to 1
- end repeat
- repeat with i = 1 to 9
- puppetSprite(i + 11, 1)
- set x to getAt(listapuzzle, i)
- set the memberNum of sprite (i + 11) to x
- end repeat
- set soluzione to list()
- repeat with i = 1 to 9
- addAt(soluzione, i, i + 30 + ((qq - 1) * 60))
- end repeat
- end
-
- on Mostralista1
- repeat with n = 12 to 20
- set the visible of sprite n to 1
- puppetSprite(n, 1)
- updateStage()
- end repeat
- end
-
- on Mostralista2
- repeat with n = 12 to 47
- set the visible of sprite n to 1
- puppetSprite(n, 1)
- updateStage()
- end repeat
- end
-
- on MOSTRALISTA3
- repeat with n = 12 to 17
- set the visible of sprite n to 1
- puppetSprite(n, 1)
- updateStage()
- end repeat
- end
-
- on Crealista2
- global listapuzzle, soluzione, qq
- set aggiungi to 1
- set listapuzzle to list()
- set x to random(36) + 46 + ((qq - 1) * 60)
- set dim to 1
- addAt(listapuzzle, 1, x)
- repeat while dim < 36
- set x to random(36) + 46 + ((qq - 1) * 60)
- repeat with j = 1 to dim
- if x = getAt(listapuzzle, j) then
- set aggiungi to 0
- end if
- end repeat
- if aggiungi then
- append(listapuzzle, x)
- set dim to dim + 1
- end if
- set aggiungi to 1
- end repeat
- repeat with i = 1 to 36
- puppetSprite(i + 11, 1)
- set x to getAt(listapuzzle, i)
- set the memberNum of sprite (i + 11) to x
- end repeat
- set soluzione to list()
- repeat with i = 1 to 36
- addAt(soluzione, i, i + 46 + ((qq - 1) * 60))
- end repeat
- end
-
- on CREALISTA3
- global listapuzzle, soluzione, qq
- set aggiungi to 1
- set listapuzzle to list()
- set x to random(6) + 40 + ((qq - 1) * 60)
- set dim to 1
- addAt(listapuzzle, 1, x)
- repeat while dim < 6
- set x to random(6) + 40 + ((qq - 1) * 60)
- repeat with j = 1 to dim
- if x = getAt(listapuzzle, j) then
- set aggiungi to 0
- end if
- end repeat
- if aggiungi then
- append(listapuzzle, x)
- set dim to dim + 1
- end if
- set aggiungi to 1
- end repeat
- repeat with i = 1 to 6
- puppetSprite(i + 11, 1)
- set x to getAt(listapuzzle, i)
- set the memberNum of sprite (i + 11) to x
- end repeat
- set soluzione to list()
- repeat with i = 1 to 6
- addAt(soluzione, i, i + 40 + ((qq - 1) * 60))
- end repeat
- end
-
- on mouseDown
- global listapuzzle, altezza, larghezza, bordi, m, msprite, grandezza
- if (larghezza > 109) and (larghezza < 475) and (altezza > 77) and (altezza < 404) then
- if grandezza = 1 then
- set c1 to 122
- set c2 to 109
- repeat with j = 0 to 2
- if (altezza < (77 + (c2 * (j + 1)))) and (altezza > (77 + (c2 * j))) then
- repeat with i = 0 to 2
- if (larghezza < (109 + (c1 * (i + 1)))) and (larghezza > (109 + (c1 * i))) then
- set m to getAt(listapuzzle, i + 1 + (3 * j))
- set bordi to rect(109 + (c1 * i), 77 + (c2 * j), 109 + (c1 * (i + 1)), 77 + (c2 * (j + 1)))
- set msprite to i + (3 * j) + 12
- end if
- end repeat
- end if
- end repeat
- end if
- if grandezza = 2 then
- set c1 to 61
- set c2 to 54
- repeat with j = 0 to 5
- if (altezza < (78 + (c2 * (j + 1)))) and (altezza > (78 + (c2 * j))) then
- repeat with i = 0 to 5
- if (larghezza < (109 + (c1 * (i + 1)))) and (larghezza > (109 + (c1 * i))) then
- set m to getAt(listapuzzle, i + 1 + (6 * j))
- set bordi to rect(109 + (c1 * i), 78 + (c2 * j), 109 + (c1 * (i + 1)), 78 + (c2 * (j + 1)))
- set msprite to i + (6 * j) + 12
- end if
- end repeat
- end if
- end repeat
- end if
- if grandezza = 3 then
- set c1 to 122
- set c2 to 165
- repeat with j = 0 to 1
- if (altezza < (76 + (c2 * (j + 1)))) and (altezza > (76 + (c2 * j))) then
- repeat with i = 0 to 2
- if (larghezza < (108 + (c1 * (i + 1)))) and (larghezza > (108 + (c1 * i))) then
- set m to getAt(listapuzzle, i + 1 + (3 * j))
- set bordi to rect(108 + (c1 * i), 76 + (c2 * j), 108 + (c1 * (i + 1)), 76 + (c2 * (j + 1)))
- set msprite to i + (3 * j) + 12
- end if
- end repeat
- end if
- end repeat
- end if
- end if
- end
-
- on mouseUp
- global larghezza, altezza, m, bordi, listapuzzle, grandezza, soluzione, msprite, qq
- if msprite <> 0 then
- if (larghezza > 109) and (larghezza < 475) and (altezza > 77) and (altezza < 404) then
- if grandezza = 1 then
- set c1 to 122
- set c2 to 109
- set n to m
- set nsprite to msprite
- repeat with j = 0 to 2
- if (altezza < (77 + (c2 * (j + 1)))) and (altezza > (77 + (c2 * j))) then
- repeat with i = 0 to 2
- if (larghezza < (109 + (c1 * (i + 1)))) and (larghezza > (109 + (c1 * i))) then
- set n to getAt(listapuzzle, i + 1 + (3 * j))
- set nsprite to i + (3 * j) + 12
- end if
- end repeat
- end if
- end repeat
- set the memberNum of sprite msprite to n
- set the memberNum of sprite nsprite to m
- set the rect of sprite msprite to bordi
- updateStage()
- set p to getAt(listapuzzle, msprite - 11)
- set q to getAt(listapuzzle, nsprite - 11)
- addAt(listapuzzle, nsprite - 11, p)
- deleteAt(listapuzzle, nsprite - 10)
- addAt(listapuzzle, msprite - 11, q)
- deleteAt(listapuzzle, msprite - 10)
- if listapuzzle = soluzione then
- giusto()
- set grandezza to 0
- end if
- end if
- if grandezza = 2 then
- set c1 to 61
- set c2 to 54
- set n to m
- set nsprite to msprite
- repeat with j = 0 to 5
- if (altezza < (78 + (c2 * (j + 1)))) and (altezza > (78 + (c2 * j))) then
- repeat with i = 0 to 5
- if (larghezza < (109 + (c1 * (i + 1)))) and (larghezza > (109 + (c1 * i))) then
- set n to getAt(listapuzzle, i + 1 + (6 * j))
- set nsprite to i + (6 * j) + 12
- end if
- end repeat
- end if
- end repeat
- set the memberNum of sprite msprite to n
- set the memberNum of sprite nsprite to m
- set the rect of sprite msprite to bordi
- updateStage()
- set p to getAt(listapuzzle, msprite - 11)
- set q to getAt(listapuzzle, nsprite - 11)
- addAt(listapuzzle, nsprite - 11, p)
- deleteAt(listapuzzle, nsprite - 10)
- addAt(listapuzzle, msprite - 11, q)
- deleteAt(listapuzzle, msprite - 10)
- if listapuzzle = soluzione then
- giusto()
- set grandezza to 0
- end if
- end if
- if grandezza = 3 then
- set c1 to 122
- set c2 to 165
- set n to m
- set nsprite to msprite
- repeat with j = 0 to 1
- if (altezza < (76 + (c2 * (j + 1)))) and (altezza > (76 + (c2 * j))) then
- repeat with i = 0 to 2
- if (larghezza < (108 + (c1 * (i + 1)))) and (larghezza > (108 + (c1 * i))) then
- set n to getAt(listapuzzle, i + 1 + (3 * j))
- set nsprite to i + (3 * j) + 12
- end if
- end repeat
- end if
- end repeat
- set the memberNum of sprite msprite to n
- set the memberNum of sprite nsprite to m
- set the rect of sprite msprite to bordi
- updateStage()
- set p to getAt(listapuzzle, msprite - 11)
- set q to getAt(listapuzzle, nsprite - 11)
- addAt(listapuzzle, nsprite - 11, p)
- deleteAt(listapuzzle, nsprite - 10)
- addAt(listapuzzle, msprite - 11, q)
- deleteAt(listapuzzle, msprite - 10)
- if listapuzzle = soluzione then
- giusto()
- set grandezza to 0
- end if
- end if
- end if
- end if
- end
-