home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- global ITEM1, WHICHPICTURE, WHICHPATTERN
- cursor(4)
- MAKEMENUBAR()
- set CURRENTMOVIE to the movie
- set charc1 to char 3 of CURRENTMOVIE
- set charc2 to char 4 of CURRENTMOVIE
- set currentnum to charc1 & charc2
- if charc1 = "0" then
- set WHICHPICTURE to value(charc2)
- else
- set WHICHPICTURE to value(currentnum)
- end if
- set cnum to the number of chars in CURRENTMOVIE
- set acode to char cnum of CURRENTMOVIE
- if acode = "G" then
- set WHICHPATTERN to 0
- else
- if acode = "B" then
- set WHICHPATTERN to 1
- else
- if acode = "M" then
- set WHICHPATTERN to 2
- else
- if acode = "W" then
- set WHICHPATTERN to 3
- end if
- end if
- end if
- end if
- go(2)
- RESETITEMS()
- REMIXDATA()
- updateStage()
- cursor(-1)
- end
-
- on RESETITEMS
- global ITEM1
- if ITEM1 <> EMPTY then
- set the ink of sprite (ITEM1 + 1) to 8
- set ITEM1 to EMPTY
- end if
- repeat with x = 2 to 17
- puppetSprite(x, 0)
- puppetSprite(x, 1)
- set the visible of sprite x to 1
- set the ink of sprite x to 8
- end repeat
- puppetSprite(18, 1)
- set ITEM1 to EMPTY
- puppetSprite(24, 1)
- puppetSprite(25, 1)
- end
-
- on SCRAMBLELETTERS
- global ITEM1, ITEM2
- cursor(4)
- set CURRENTMOVIE to the movie
- set cnum to the number of chars in CURRENTMOVIE
- set acode to char cnum of CURRENTMOVIE
- if acode = "B" then
- repeat with x = 2 to 17
- set hpos to random(286)
- set vpos to random(267)
- set the locH of sprite x to hpos
- set the locV of sprite x to vpos
- end repeat
- cursor(-1)
- exit
- end if
- if acode = "W" then
- repeat with x = 2 to 17
- set hpos to random(286)
- set vpos to random(267)
- set awidth to the width of sprite x
- set aheight to the height of sprite x
- if (hpos + awidth) > 412 then
- set overlap to hpos + awidth - 420
- set hpos to hpos - overlap
- end if
- if (vpos + aheight) > 384 then
- set overlap to vpos + aheight - 384
- set vpos to vpos - overlap
- end if
- set the locH of sprite x to hpos
- set the locV of sprite x to vpos
- end repeat
- cursor(-1)
- exit
- end if
- set ITEM1 to EMPTY
- set ITEM2 to EMPTY
- set loclist to "51,48" & RETURN & "51,144" & RETURN & "51,240" & RETURN & "51,336" & RETURN & "154,48" & RETURN & "154,144" & RETURN & "154,240" & RETURN & "154,336" & RETURN & "257,48" & RETURN & "257,144" & RETURN & "257,240" & RETURN & "257,336" & RETURN & "360,48" & RETURN & "360,144" & RETURN & "360,240" & RETURN & "360,336"
- set rnum to 16
- repeat with x = 1 to 16
- set goodnum to "False"
- repeat while goodnum = "False"
- set anum to random(rnum)
- set sdata to line anum of loclist
- if (anum <> x) and (sdata <> "Used") then
- set goodnum to "True"
- if anum = rnum then
- set rnum to rnum - 1
- end if
- next repeat
- end if
- if (anum = x) and (x = 16) and (sdata <> "Used") then
- set goodnum to "True"
- if anum = rnum then
- set rnum to rnum - 1
- end if
- end if
- end repeat
- set thenum to x
- set anxx to item 1 of line anum of loclist
- set anyy to item 2 of line anum of loclist
- put "Used" into line anum of loclist
- set the locH of sprite (thenum + 1) to value(anxx)
- set the locV of sprite (thenum + 1) to value(anyy)
- if (thenum = 16) and (acode = "M") then
- set the visible of sprite (thenum + 1) to 0
- end if
- end repeat
- cursor(-1)
- end
-
- on MOVETHEITEM anum
- set curmh to the mouseH
- set curmv to the mouseV
- set asprite to anum + 1
- set curh to the locH of sprite asprite
- set curv to the locV of sprite asprite
- set aLeft to the left of sprite asprite
- set aRight to the right of sprite asprite
- set aTop to the top of sprite asprite
- set abottom to the bottom of sprite asprite
- set awidth to aRight - aLeft
- set aheight to abottom - aTop
- set halfwidth to integer(awidth)
- set halfheight to integer(aheight)
- set hdiff to curh - curmh
- set vdiff to curv - curmv
- puppetSound("TishLoop")
- repeat while the mouseDown = 1
- set newh to the mouseH + hdiff
- set newv to the mouseV + vdiff
- if (newh > 0) and (newh < (412 - awidth)) then
- set the locH of sprite asprite to the mouseH + hdiff
- else
- if newh <= 0 then
- set the locH of sprite asprite to 0
- else
- if newh >= (412 - awidth) then
- set the locH of sprite asprite to 412 - awidth
- else
- set the locH of sprite asprite to the mouseH + hdiff
- end if
- end if
- end if
- if (newv > 0) and (newv < (384 - aheight)) then
- set the locV of sprite asprite to the mouseV + vdiff
- else
- if newv <= 0 then
- set the locV of sprite asprite to 0
- else
- if newv >= (384 - aheight) then
- set the locV of sprite asprite to 384 - aheight
- else
- set the locV of sprite asprite to the mouseV + vdiff
- end if
- end if
- end if
- updateStage()
- end repeat
- sound stop 1
- sound stop 2
- CHECKWHEREITSLEFT(anum)
- set finalpos to CHECKLOCATIONS()
- if finalpos = "True" then
- CYCLETHEIMAGE()
- end if
- end
-
- on GETLOCATIONLIST
- set CURRENTMOVIE to the movie
- set cnum to the number of chars in CURRENTMOVIE
- set acode to char cnum of CURRENTMOVIE
- if acode = "B" then
- set theList to "0,0" & RETURN & "0,85" & RETURN & "0,192" & RETURN & "0,276" & RETURN & "103,0" & RETURN & "92,96" & RETURN & "103,181" & RETURN & "92,288" & RETURN & "195,0" & RETURN & "206,85" & RETURN & "195,192" & RETURN & "206,276" & RETURN & "309,0" & RETURN & "309,96" & RETURN & "297,181" & RETURN & "309,288"
- else
- if acode = "G" then
- set theList to "51,48" & RETURN & "51,144" & RETURN & "51,240" & RETURN & "51,336" & RETURN & "154,48" & RETURN & "154,144" & RETURN & "154,240" & RETURN & "154,336" & RETURN & "257,48" & RETURN & "257,144" & RETURN & "257,240" & RETURN & "257,336" & RETURN & "360,48" & RETURN & "360,144" & RETURN & "360,240" & RETURN & "360,336"
- else
- if acode = "M" then
- set theList to "51,48" & RETURN & "51,144" & RETURN & "51,240" & RETURN & "51,336" & RETURN & "154,48" & RETURN & "154,144" & RETURN & "154,240" & RETURN & "154,336" & RETURN & "257,48" & RETURN & "257,144" & RETURN & "257,240" & RETURN & "257,336" & RETURN & "360,48" & RETURN & "360,144" & RETURN & "360,240" & RETURN & "360,336"
- else
- if acode = "W" then
- set theList to "0,0" & RETURN & "45,0" & RETURN & "133,0" & RETURN & "273,0" & RETURN & "0,76" & RETURN & "175,53" & RETURN & "111,118" & RETURN & "60,140" & RETURN & "276,112" & RETURN & "0,191" & RETURN & "133,173" & RETURN & "249,190" & RETURN & "0,231" & RETURN & "26,268" & RETURN & "151,277" & RETURN & "276,303"
- end if
- end if
- end if
- end if
- return theList
- end
-
- on CHECKPOSITIONS
- set loclist to GETLOCATIONLIST()
- repeat with x = 1 to 16
- set tempx to item 1 of line x of loclist
- set tempy to item 2 of line x of loclist
- set asprite to x + 1
- set curx to the locH of sprite asprite
- set cury to the locV of sprite asprite
- if (curx <> tempx) or (cury <> tempy) then
- return "False"
- exit
- end if
- end repeat
- return "True"
- end
-
- on CHECKLOCATIONS
- set theList to GETLOCATIONLIST()
- repeat with x = 1 to 16
- set asprite to x + 1
- set curx to the locH of sprite asprite
- set cury to the locV of sprite asprite
- set tempx to item 1 of line x of theList
- set tempy to item 2 of line x of theList
- if (curx <> tempx) or (cury <> tempy) then
- return "False"
- end if
- end repeat
- return "True"
- end
-
- on CHECKWHEREITSLEFT anum
- set theList to GETLOCATIONLIST()
- set asprite to anum + 1
- set curh to the locH of sprite asprite
- set cury to the locV of sprite asprite
- set destloc to line anum of theList
- set destx to item 1 of destloc
- set desty to item 2 of destloc
- if (curh >= (destx - 10)) and (curh <= (destx + 10)) and ((cury >= (desty - 10)) and (cury <= (desty + 10))) then
- set the locH of sprite asprite to value(destx)
- set the locV of sprite asprite to value(desty)
- updateStage()
- end if
- end
-
- on CYCLETHEIMAGE
- set clist to "1,5,9,13,14,10,6,2,3,7,11,15,16,12,8,4"
- puppetSound("Sparkle")
- repeat with x = 1 to 16
- set asprite to item x of clist
- set asprite to value(asprite)
- set actSprite to asprite + 1
- set the ink of sprite actSprite to 6
- updateStage()
- if x <> 1 then
- set inum to x - 1
- set asprite to item inum of clist
- set asprite to value(asprite)
- set actSprite to asprite + 1
- set the ink of sprite actSprite to 8
- updateStage()
- end if
- end repeat
- set asprite to item 16 of clist
- set asprite to value(asprite)
- set actSprite to asprite + 1
- set the ink of sprite actSprite to 8
- updateStage()
- set cnum to the number of cast 17
- set the castNum of sprite 2 to cnum
- set the locH of sprite 2 to 206
- set the locV of sprite 2 to 192
- repeat with x = 3 to 17
- set the visible of sprite x to 0
- end repeat
- sound stop 1
- sound stop 2
- updateStage()
- end
-
- on FIGURETHELIST anum
- set blankh to the locH of sprite 17
- set blankv to the locV of sprite 17
- set asprite to anum + 1
- set clickh to the locH of sprite asprite
- set clickv to the locV of sprite asprite
- set temph to clickh
- set tempv to clickv
- if blankh > clickh then
- set hdiff to 103
- else
- if blankh < clickh then
- set hdiff to -103
- else
- set hdiff to 0
- end if
- end if
- if blankv > clickv then
- set vdiff to 96
- else
- if blankv < clickv then
- set vdiff to -96
- else
- set vdiff to 0
- end if
- end if
- set cordlist to clickh & "," & clickv & RETURN
- repeat with x = 1 to 4
- set temph to temph + hdiff
- set tempv to tempv + vdiff
- if (temph = blankh) and (tempv = blankv) then
- exit repeat
- end if
- set cordlist to cordlist & temph & "," & tempv & RETURN
- end repeat
- set cnum to the number of lines in cordlist
- set thedata to EMPTY
- repeat with x = 1 to 15
- set asprite to x + 1
- set testh to the locH of sprite asprite
- set testv to the locV of sprite asprite
- set astr to testh & "," & testv
- if cordlist contains astr then
- repeat with y = 1 to cnum
- if line y of cordlist = astr then
- put x & "," & testh & "," & testv into line y of thedata
- exit repeat
- end if
- end repeat
- end if
- if the number of lines in thedata = 4 then
- exit repeat
- end if
- end repeat
- return thedata
- end
-
- on MIXANDMATCH anum
- set CURRENTMOVIE to the movie
- set cnum to the number of chars in CURRENTMOVIE
- set acode to char cnum of CURRENTMOVIE
- if acode = "M" then
- MIXMANDMATCH(anum)
- else
- if acode = "G" then
- MIXGANDMATCH(anum)
- end if
- end if
- end
-
- on MIXMANDMATCH anum
- set blankh to the locH of sprite 17
- set blankv to the locV of sprite 17
- set asprite to anum + 1
- set clickh to the locH of sprite asprite
- set clickv to the locV of sprite asprite
- if (clickh = blankh) and (clickv = blankv) then
- exit
- end if
- puppetSound("Puz2")
- set the ink of sprite asprite to 6
- updateStage()
- delay(20)
- set the ink of sprite asprite to 8
- updateStage()
- if (blankh = clickh) or (blankv = clickv) then
- set theList to FIGURETHELIST(anum)
- else
- set hdiff to clickh - blankh
- set vdiff to clickv - blankv
- set htimes to hdiff / 103
- set vtimes to vdiff / 96
- if htimes < 0 then
- set htimes to htimes * -1
- end if
- if vtimes < 0 then
- set vtimes to vtimes * -1
- end if
- if htimes <> vtimes then
- exit
- end if
- set theList to FIGURETHELIST(anum)
- end if
- puppetSound("Puz3")
- set lnum to the number of lines in theList
- repeat with x = 1 to lnum
- set asprite to item 1 of line x of theList
- if x <> lnum then
- set anh to item 2 of line x + 1 of theList
- set any to item 3 of line x + 1 of theList
- else
- set anh to blankh
- set any to blankv
- end if
- set asprite to integer(asprite)
- set anh to integer(anh)
- set anv to integer(any)
- set asprite to asprite + 1
- set the locH of sprite asprite to anh
- set the locV of sprite asprite to anv
- end repeat
- set the locH of sprite 17 to clickh
- set the locV of sprite 17 to clickv
- updateStage()
- set aRes to CHECKPOSITIONS()
- if aRes = "True" then
- CYCLETHEIMAGE()
- end if
- end
-
- on MIXGANDMATCH anum
- global ITEM1, ITEM2
- if ITEM1 = EMPTY then
- set ITEM1 to anum
- puppetSound("Puz2")
- set asprite to anum + 1
- set the ink of sprite asprite to 6
- updateStage()
- exit
- end if
- if ITEM1 = anum then
- set ITEM1 to EMPTY
- puppetSound("Puz2")
- set asprite to anum + 1
- set the ink of sprite asprite to 8
- updateStage()
- exit
- end if
- set asprite to ITEM1 + 1
- set the ink of sprite asprite to 8
- set asprite to anum + 1
- set tempx to the locH of sprite asprite
- set tempy to the locV of sprite asprite
- puppetSound("Puz3")
- set the locH of sprite asprite to the locH of sprite (ITEM1 + 1)
- set the locV of sprite asprite to the locV of sprite (ITEM1 + 1)
- set asprite to ITEM1 + 1
- set the locH of sprite asprite to tempx
- set the locV of sprite asprite to tempy
- set ITEM1 to EMPTY
- updateStage()
- set aRes to CHECKPOSITIONS()
- if aRes = "True" then
- CYCLETHEIMAGE()
- end if
- end
-