home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- global posicao, lateral, pode, locali, quadro, pedras, menulat, final, inicio, programa, aparece
- set the exitLock to 1
- set aparece to 0
- set programa to 2
- puppetSprite(48, 1)
- set the memberNum of sprite 48 to the number of member 19 of castLib "FOLHINHA.SRD"
- set inicio to 0
- set final to 26
- set pedras to 0
- set pode to 1
- set lateral to 1
- set quadro to [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
- set posicao to [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
- set locali to [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
- set total to 4
- set menulat to posicao
- end
-
- on stopMovie
- global aparece, programa
- set aparece to 0
- set programa to 0
- puppetSprite(48, 0)
- end
-
- on gerapuzzle
- global posicao
- repeat with i = 1 to 25
- set flagp to 0
- repeat while flagp = 0
- set nume to random(25)
- set j to 1
- set flag2 to 1
- repeat while (j <= i) and (flag2 = 1)
- set ajuda to getAt(posicao, j)
- if ajuda = nume then
- set flag2 to 0
- end if
- set j to j + 1
- end repeat
- if flag2 = 1 then
- set flagp to 1
- setAt(posicao, i, nume)
- end if
- end repeat
- end repeat
- end
-
- on geracast
- global posicao, qualpuzz, numpuzz
- repeat with i = 1 to 25
- set the castNum of sprite (9 + i) to getAt(posicao, i) + qualpuzz
- end repeat
- set the castNum of sprite 9 to numpuzz + 30
- set the castNum of sprite 36 to numpuzz
- end
-
- on checa qu
- global locali
- set nloc to getAt(locali, qu - 9)
- return nloc
- end
-
- on sobe
- global lateral, pode, final
- if pode = 1 then
- lche()
- if lateral <= (final - 5) then
- set lateral to lateral + 1
- if not checa(8 + lateral) then
- set the locV of sprite (8 + lateral) to -300
- set the moveableSprite of sprite (8 + lateral) to 0
- end if
- repeat with i = 1 to 4
- if not checa(8 + lateral + i) then
- set the locV of sprite (8 + i + lateral) to 70 + (i * 85)
- set the moveableSprite of sprite (8 + i + lateral) to 1
- set the locH of sprite (8 + i + lateral) to 583
- end if
- end repeat
- else
- beep()
- end if
- end if
- set the locV of sprite 8 to -1000
- updateStage()
- end
-
- on desce
- global lateral, pode, inicio
- if pode = 1 then
- lche()
- if lateral > (inicio + 1) then
- set lateral to lateral - 1
- if not checa(13 + lateral) then
- set the locV of sprite (13 + lateral) to -300
- set the moveableSprite of sprite (13 + lateral) to 0
- end if
- repeat with i = 1 to 4
- if not checa(8 + i + lateral) then
- set the locV of sprite (8 + i + lateral) to 70 + (i * 85)
- set the moveableSprite of sprite (8 + i + lateral) to 1
- set the locH of sprite (8 + i + lateral) to 583
- end if
- end repeat
- else
- beep()
- end if
- end if
- set the locV of sprite 8 to -1000
- updateStage()
- end
-
- on lche
- global locali, inicio, final
- set nn to 1
- set i to 0
- repeat while nn = 1
- set i to i + 1
- set nn to getAt(locali, i)
- end repeat
- set inicio to i - 1
- set nn to 1
- set i to 26
- repeat while nn = 1
- set i to i - 1
- set nn to getAt(locali, i)
- end repeat
- set final to i + 1
- end
-
- on voltar
- global qspr, lvant, lhant, locali, pedras
- puppetSound(0)
- updateStage()
- puppetSound("errado")
- updateStage()
- setAt(locali, qspr - 9, 0)
- if lvant < 0 then
- set lvant to -200
- end if
- if lvant > 480 then
- set lvant to 600
- end if
- set lv to the locV of sprite qspr
- set lh to the locH of sprite qspr
- set pedras to pedras - 1
- variapeca(lv, lh, lvant, lhant, qspr)
- end
-
- on checgeral
- global quadro
- set ff to 1
- repeat with i = 1 to 5
- repeat with j = 1 to 5
- set linha to ((i - 1) * 5) + j
- if getAt(quadro, linha) <> linha then
- set ff to 0
- end if
- end repeat
- end repeat
- if ff = 1 then
- set the locH of sprite 36 to 233
- go(marker(1))
- end if
- end
-
- on menul qt
- global menulat, menupos, inicio, final
- set ii to 1
- set menupos to 0
- repeat while (ii <= 25) and (menupos = 0)
- set mm to getAt(menulat, ii)
- if mm = qt then
- set menupos to ii
- end if
- set ii to ii + 1
- end repeat
- end
-
- on variapeca rv1, rh1, rv2, rh2, spr
- set difv to abs(rv1 - rv2)
- set difh to abs(rh1 - rh2)
- set contv to 0
- set conth to 0
- repeat while (rv1 <> rv2) or (rh1 <> rh2)
- if rv1 > rv2 then
- set contv to contv + 3
- if contv > difv then
- set contv to contv - 2
- set rv1 to rv1 - 1
- else
- set rv1 to rv1 - 3
- end if
- end if
- if rv1 < rv2 then
- set contv to contv + 3
- if contv > difv then
- set contv to contv - 2
- set rv1 to rv1 + 1
- else
- set rv1 to rv1 + 3
- end if
- end if
- if rh1 > rh2 then
- set conth to conth + 3
- if conth > difh then
- set rh1 to rh1 - 1
- set conth to conth - 2
- else
- set rh1 to rh1 - 3
- end if
- end if
- if rh1 < rh2 then
- set conth to conth + 3
- if conth > difh then
- set rh1 to rh1 + 1
- set conth to conth - 2
- else
- set rh1 to rh1 + 3
- end if
- end if
- set the locV of sprite spr to rv1
- set the locH of sprite spr to rh1
- updateStage()
- end repeat
- end
-
- on acabar
- global quadro, menupos
- set qr to [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
- repeat with i = 1 to 5
- repeat with j = 1 to 5
- set ij to ((i - 1) * 5) + j
- set mr to getAt(quadro, ij)
- if mr <> 0 then
- setAt(qr, mr, mr)
- if mr <> ij then
- menul(mr)
- set vv to the locV of sprite (menupos + 9)
- set vh to the locH of sprite (menupos + 9)
- set xh to (mr mod 5) - 1
- if xh = -1 then
- set xh to 4
- end if
- set xh to (xh * 80) + 73
- set xv to (integer((mr - 1) / 5) * 80) + 79
- variapeca(((i - 1) * 80) + 79, ((j - 1) * 80) + 73, xv, xh, menupos + 9)
- end if
- end if
- end repeat
- end repeat
- set quadro to qr
- end
-
- on arrumar
- global qspr, numv, numh, locali, quadro, rv, rh, pedras, qualpuzz
- puppetSound(0)
- updateStage()
- puppetSound("certo")
- updateStage()
- setAt(locali, qspr - 9, 1)
- set lv to the locV of sprite qspr
- set lh to the locH of sprite qspr
- set posh to 73
- set numv to 1
- set numh to 1
- set posv to 79
- repeat while (lv < (posv - 40)) or (lv > (posv + 40))
- set posv to posv + 80
- set numv to numv + 1
- end repeat
- repeat while (lh < (posh - 40)) or (lh > (posh + 40))
- set posh to posh + 80
- set numh to numh + 1
- end repeat
- set the locV of sprite qspr to posv
- set the locH of sprite qspr to posh
- updateStage()
- set qq to ((numv - 1) * 5) + numh
- if getAt(quadro, qq) <> 0 then
- if rv = -1 then
- voltar()
- else
- set the locV of sprite qspr to 79 + ((rv - 1) * 80)
- set the locH of sprite qspr to 73 + ((rh - 1) * 80)
- setAt(quadro, ((rv - 1) * 5) + rh, the castNum of sprite qspr - qualpuzz)
- end if
- else
- setAt(quadro, qq, the castNum of sprite qspr - qualpuzz)
- end if
- updateStage()
- end
-