home *** CD-ROM | disk | FTP | other *** search
- on scramb startCast
- global spriteCnt, spriteHolder, randNum
- set randNum to 0
- set spriteCnt to 1
- set spriteHolder to " "
- repeat while spriteCnt <= 9
- set randNum to random(9)
- if CheckDup(randNum) then
- nothing()
- next repeat
- end if
- put randNum & " " into word spriteCnt of spriteHolder
- set x to word spriteCnt of spriteHolder
- set x to x * 1
- set spriteCnt to spriteCnt + 1
- set the castNum of sprite spriteCnt to startCast + randNum
- updateStage()
- end repeat
- end
-
- on CheckDup whichSprite
- global spriteHolder
- set y to 1
- repeat while y <= 9
- set tempResult to word y of spriteHolder
- set tempResult to tempResult * 1
- set answer to tempResult - whichSprite
- if answer = 0 then
- return 1
- else
- nothing()
- end if
- set y to y + 1
- end repeat
- return 0
- end
-
- on checkClick
- global i
- set i to the clickOn
- end
-
- on MakeInvisible begSprite, endSprite, trueOrFalse
- repeat with index = begSprite to endSprite
- set the visible of sprite index to trueOrFalse
- end repeat
- end
-
- on makePuppet begSprite, endSprite, trueOrFalse
- repeat with index = begSprite to endSprite
- set the immediate of sprite index to trueOrFalse
- puppetSprite(index, trueOrFalse)
- end repeat
- end
-
- on slowMove whichSprt, vert, horz, speed
- set flag to 0
- set horzloc to the locH of sprite whichSprt
- set vertloc to the locV of sprite whichSprt
- if the locH of sprite whichSprt < horz then
- repeat while the locH of sprite whichSprt < horz
- set horzloc to horzloc + speed
- set the locH of sprite whichSprt to horzloc
- updateStage()
- end repeat
- else
- if the locH of sprite whichSprt > horz then
- repeat while the locH of sprite whichSprt > horz
- set horzloc to horzloc - speed
- set the locH of sprite whichSprt to horzloc
- updateStage()
- end repeat
- end if
- end if
- if the locV of sprite whichSprt < vert then
- repeat while the locV of sprite whichSprt < vert
- set vertloc to vertloc + speed
- set the locV of sprite whichSprt to vertloc
- updateStage()
- end repeat
- else
- if the locV of sprite whichSprt > vert then
- repeat while the locV of sprite whichSprt > vert
- set vertloc to vertloc - speed
- set the locV of sprite whichSprt to vertloc
- updateStage()
- end repeat
- end if
- end if
- end
-
- on MoveTheSprite topV, topH, topIntV, topIntH, whichSprite, whichSound, maxCnt
- global done, currCount, inPlace
- puppetSound("Zip By.AIFF")
- set topIntV to the locV of sprite the clickOn
- set topIntH to the locH of sprite the clickOn
- repeat while the mouseDown
- set the locH of sprite the clickOn to the mouseH
- set the locV of sprite the clickOn to the mouseV
- updateStage()
- end repeat
- if sprite the clickOn intersects whichSprite then
- set inPlace to 1
- puppetSound(whichSound)
- slowMove(the clickOn, topV, topH, 1)
- set currCount to currCount + 1
- if currCount = maxCnt then
- set done to 1
- else
- set done to 0
- end if
- updateStage()
- exit
- else
- set inPlace to 0
- set the locV of sprite the clickOn to topIntV
- set the locH of sprite the clickOn to topIntH
- puppetSound("Cartoon Boing 2")
- updateStage()
- end if
- end
-
- on button whereToGo, startSp, endSp, trueOrFalse
- set spriteNum to the clickOn
- set castName to the name of cast the castNum of sprite spriteNum
- set the castNum of sprite spriteNum to the number of cast (castName & "Dn")
- puppetSound("Click")
- updateStage()
- repeat while the mouseDown
- if rollOver(spriteNum) then
- set the castNum of sprite spriteNum to the number of cast (castName & "Dn")
- else
- set the castNum of sprite spriteNum to the number of cast castName
- end if
- updateStage()
- end repeat
- set the castNum of sprite spriteNum to the number of cast castName
- updateStage()
- CheckSound()
- makePuppet(startSp, endSp, trueOrFalse)
- if whereToGo = EMPTY then
- exit
- end if
- go(whereToGo)
- end
-
- on CheckSound
- repeat while soundBusy(1)
- nothing()
- end repeat
- puppetSound(0)
- end
-