home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- global gPlayer, gTimeOut
- set gPlayer to 1
- set gTimeOut to 600
- end
-
- on getCard
- global gCard
- set gCard to random(9)
- return gCard
- end
-
- on registerCard
- global gCardNum
- set gCardNum to chars(the name of cast the castNum of sprite 2, 1, 3)
- end
-
- on init
- global gTimeCount, gDirs, gBigCards, gFirstHead, gFirstProp, gFirstBack, gFirstBody, gHeads, gProps, gBacks, gBodys
- set gTimeCount to 0
- set gDirs to [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
- set gBigCards to [1, 1, 1, 1]
- set gFirstHead to 3
- set gFirstProp to 3
- set gFirstBack to 3
- set gFirstBody to 3
- set gHeads to [27, 19, 7, 38, 50, 60, 71, 81, 92]
- set gProps to [30, 22, 10, 41, 53, 63, 75, 84, 95]
- set gBacks to [23, 13, 3, 33, 45, 56, 66, 77, 87]
- set gBodys to [24, 16, 4, 35, 47, 57, 68, 78, 89]
- startTimer()
- end
-
- on animCards
- global gDirs
- repeat with i = 17 to 28
- set n to the name of cast the castNum of sprite i
- set nn to the name of cast (the castNum of sprite i + getAt(gDirs, i - 16))
- if chars(n, 1, 8) = chars(nn, 1, 8) then
- set the castNum of sprite i to the castNum of sprite i + getAt(gDirs, i - 16)
- else
- setAt(gDirs, i - 16, 0 - getAt(gDirs, i - 16))
- end if
- proportionalStretch(i, i - 16)
- if sprite 39 intersects i then
- if the mouseDown then
- deleteBigCard(i)
- set the width of sprite i to the width of cast the castNum of sprite i
- set the height of sprite i to the height of cast the castNum of sprite i
- else
- setBigCard(i)
- RainaltsWonder(i, i - 16)
- if checkIt() then
- setAntenne()
- goStrip()
- abort()
- end if
- end if
- next repeat
- end if
- RainaltsWonder(i, i - 16)
- end repeat
- repeat with i = 13 to 16
- set n to the name of cast the castNum of sprite i
- set nn to the name of cast (the castNum of sprite i + getAt(gDirs, i - 12))
- if chars(n, 1, 8) = chars(nn, 1, 8) then
- set the castNum of sprite i to the castNum of sprite i + getAt(gDirs, i - 12)
- next repeat
- end if
- setAt(gDirs, i - 12, 0 - getAt(gDirs, i - 12))
- end repeat
- updateStage()
- end
-
- on setBigCard sp
- global gBigCards
- if the name of cast the castNum of sprite sp contains "head" then
- set the castNum of sprite 16 to the castNum of sprite sp
- set the stretch of sprite 16 to 0
- set the locH of sprite 16 to the locH of sprite sp
- set the locV of sprite 16 to the locV of sprite sp
- setAt(gBigCards, 4, the castNum of sprite sp)
- end if
- if the name of cast the castNum of sprite sp contains "back" then
- set the castNum of sprite 13 to the castNum of sprite sp
- set the stretch of sprite 13 to 0
- set the locH of sprite 13 to the locH of sprite 39
- set the locV of sprite 13 to the locV of sprite 39
- setAt(gBigCards, 1, the castNum of sprite sp)
- end if
- if the name of cast the castNum of sprite sp contains "body" then
- set the castNum of sprite 14 to the castNum of sprite sp
- set the stretch of sprite 14 to 0
- set the locH of sprite 14 to the locH of sprite sp
- set the locV of sprite 14 to the locV of sprite sp
- setAt(gBigCards, 2, the castNum of sprite sp)
- end if
- if the name of cast the castNum of sprite sp contains "prop" then
- set the castNum of sprite 15 to the castNum of sprite sp
- set the stretch of sprite 15 to 0
- set the locH of sprite 15 to the locH of sprite sp
- set the locV of sprite 15 to the locV of sprite sp
- setAt(gBigCards, 3, the castNum of sprite sp)
- end if
- end
-
- on deleteBigCard sp
- global gBigCards
- if the name of cast the castNum of sprite sp contains "head" then
- set the locH of sprite 16 to 1000
- set the locV of sprite 28 to 1000
- end if
- if the name of cast the castNum of sprite sp contains "back" then
- set the locH of sprite 13 to 1000
- set the locV of sprite 13 to 1000
- end if
- if the name of cast the castNum of sprite sp contains "body" then
- set the locH of sprite 14 to 1000
- set the locV of sprite 14 to 1000
- end if
- if the name of cast the castNum of sprite sp contains "prop" then
- set the locH of sprite 15 to 1000
- set the locV of sprite 15 to 1000
- end if
- end
-
- on scrollCards
- global gFirstHead, gFirstProp, gFirstBack, gFirstBody, gHeads, gProps, gBacks, gBodys
- if rollOver(31) then
- set gFirstHead to dec(gFirstHead, 1, 9)
- scrollIt(23, gHeads, gFirstHead, 3)
- end if
- if rollOver(32) then
- set gFirstHead to inc(gFirstHead, 1, 9)
- scrollIt(23, gHeads, gFirstHead, 3)
- end if
- if rollOver(33) then
- set gFirstProp to dec(gFirstProp, 1, 9)
- scrollIt(26, gProps, gFirstProp, 3)
- end if
- if rollOver(34) then
- set gFirstProp to inc(gFirstProp, 1, 9)
- scrollIt(26, gProps, gFirstProp, 3)
- end if
- if rollOver(35) then
- set gFirstBack to dec(gFirstBack, 1, 9)
- scrollIt(17, gBacks, gFirstBack, 3)
- end if
- if rollOver(36) then
- set gFirstBack to inc(gFirstBack, 1, 9)
- scrollIt(17, gBacks, gFirstBack, 3)
- end if
- if rollOver(37) then
- set gFirstBody to dec(gFirstBody, 1, 9)
- scrollIt(20, gBodys, gFirstBody, 3)
- end if
- if rollOver(38) then
- set gFirstBody to inc(gFirstBody, 1, 9)
- scrollIt(20, gBodys, gFirstBody, 3)
- end if
- end
-
- on scrollIt sp, li, be, n
- set ret to getListAt(li, 1, count(li), be, n)
- repeat with i = 1 to n
- set the castNum of sprite (i + sp - 1) to getAt(ret, i)
- proportionalStretch(i + sp - 1, i + sp - 1 - 16)
- RainaltsWonder(i + sp - 1, i + sp - 1 - 16)
- end repeat
- end
-
- on RainaltsWonder x, y
- if not (the mouseDown) then
- set the locH of sprite x to the locH of sprite y
- set the locV of sprite x to the locV of sprite y
- end if
- end
-
- on bigCardsNames
- global gBigCards
- set ret to EMPTY
- repeat with i = 1 to 4
- set ret to ret && the name of cast getAt(gBigCards, i)
- end repeat
- return ret
- end
-
- on proportionalStretch org, dest
- set coefX to the width of sprite dest / float(the width of cast the castNum of sprite org)
- set coefY to the height of sprite dest / float(the height of cast the castNum of sprite org)
- if min(coefX, coefY) < 1 then
- set the width of sprite org to the width of cast the castNum of sprite org * min(coefX, coefY)
- set the height of sprite org to the height of cast the castNum of sprite org * min(coefX, coefY)
- else
- set the width of sprite org to the width of cast the castNum of sprite org
- set the height of sprite org to the height of cast the castNum of sprite org
- end if
- end
-
- on inc n, mn, mx
- set n to n + 1
- if n > mx then
- set n to mn
- end if
- return n
- end
-
- on dec n, mn, mx
- set n to n - 1
- if n < mn then
- set n to mx
- end if
- return n
- end
-
- on getListAt refList, sta, sto, ir, n
- set ret to list()
- set x to ir
- repeat with i = 1 to n
- addAt(ret, i, getAt(refList, x))
- set x to x + 1
- if x > sto then
- set x to sta
- end if
- end repeat
- return ret
- end
-
- on checkIt
- global gBigCards, gCardNum
- repeat with i = 1 to 4
- if chars(the name of cast getAt(gBigCards, i), 1, 3) <> gCardNum then
- return 0
- end if
- end repeat
- return 1
- end
-
- on MoveTime
- global gTimeOut, gTimeCount, gPlayer
- if the timer > gTimeOut then
- startTimer()
- set gTimeCount to gTimeCount + 1
- if gTimeCount > 15 then
- go(the frame + 1)
- end if
- if gPlayer = 1 then
- set the castNum of sprite 30 to cast "time 0"
- set the castNum of sprite 29 to cast ("time" && 1 + (gTimeCount mod 9))
- else
- set the castNum of sprite 29 to cast "time 0"
- set the castNum of sprite 30 to cast ("time" && 1 + (gTimeCount mod 9))
- end if
- end if
- end
-