home *** CD-ROM | disk | FTP | other *** search
- property mysound, myseq, mysprite, mycast, mystH, mystV, myenH, myenV, isHeard, active, myname
-
- on birth me, pos, rand, chnum
- global offs, offs2
- set mysound to word pos of field "sounds"
- set myname to word chnum of field "names"
- set mysprite to pos + offs
- set mycast to the number of cast myname + pos
- set mystH to value(word rand of field (myname & "stHs"))
- set mystV to value(word rand of field (myname & "stVs"))
- set myenH to value(word pos of field (myname & "enHs"))
- set myenV to value(word pos of field (myname & "enVs"))
- set active to 1
- set the castNum of sprite mysprite to mycast
- set the locH of sprite mysprite to mystH
- set the locV of sprite mysprite to mystV
- return me
- end
-
- on say me
- puppetSound(mysound)
- updateStage()
- end
-
- on highlight me
- global emtol, blankcast, whichsprite, whichword, mover, moverspr
- if active then
- set the castNum of sprite moverspr to mycast
- set the castNum of sprite mysprite to blankcast
- set mover to mysprite
- set the visible of sprite moverspr to 1
- end if
- end
-
- on unhighlight1 me
- global moverspr
- if active then
- set the castNum of sprite moverspr to mycast
- puppetSound(0)
- updateStage()
- end if
- end
-
- on unhighlight2 me
- global blankcast, mover, moverspr
- set the castNum of sprite moverspr to blankcast
- set mover to 2
- set the castNum of sprite mysprite to mycast
- end
-
- on iscorrect me, curx, cury
- global numCorrect, blankcast, whichsprite, emtol
- if (abs(curx - myenH) <= emtol) and (abs(cury - myenV) <= emtol) then
- return 1
- else
- return(FLASE)
- end if
- end
-
- on finish me
- global numCorrect
- if active then
- set numCorrect to numCorrect + 1
- set the locH of sprite mysprite to myenH
- set the locV of sprite mysprite to myenV
- puppetSound("positive")
- set active to 0
- set the moveableSprite of sprite mysprite to 0
- end if
- end
-
- on moveBackDown me, curH, curV
- global moverspr
- set stpsz to 8
- set curH to the locH of sprite moverspr
- set curV to the locV of sprite moverspr
- set dV to float(mystV - curV)
- set dH to float(mystH - curH)
- if dH <> 0 then
- if dH < 0 then
- set sgn to -1
- else
- set sgn to 1
- end if
- set theta to atan(dV / dH)
- set dist to sqrt((dV * dV) + (dH * dH))
- repeat while not checkIn(curH, curV, mystH, mystV, stpsz)
- set curH to curH + (sgn * stpsz * cos(theta))
- set curV to curV + (sgn * stpsz * sin(theta))
- set the locH of sprite moverspr to curH
- set the locV of sprite moverspr to curV
- updateStage()
- end repeat
- set the locH of sprite moverspr to mystH
- set the locV of sprite moverspr to mystV
- set the locH of sprite mysprite to mystH
- set the locV of sprite mysprite to mystV
- updateStage()
- else
- if dV < 0 then
- set sgn to -1
- else
- set sgn to 1
- end if
- repeat while not checkIn(curH, curV, mystH, mystV, stpsz)
- set curV to curV + (sgn * stpsz)
- set the locV of sprite moverspr to curV
- updateStage()
- end repeat
- set the locH of sprite moverspr to mystH
- set the locV of sprite moverspr to mystV
- set the locH of sprite mysprite to mystH
- set the locV of sprite mysprite to mystV
- end if
- end
-
- on checkIn x, y, endx, endy, tol
- if (abs(x - endx) <= tol) and (abs(y - endy) <= tol) then
- return 1
- else
- return 0
- end if
- end
-
- on canHelp me
- if active then
- return 1
- else
- return 0
- end if
- end
-
- on dohelp me
- global numCorrect
- set nofrs to 25
- stopEvents()
- puppetSound("TsayHelp.AIF")
- updateStage()
- repeat while soundBusy(1)
- end repeat
- set the puppet of sprite 48 to 1
- set the castNum of sprite 48 to the number of cast "cursorcast"
- set the visible of sprite 48 to 1
- set the locH of sprite 48 to the mouseH
- set the locV of sprite 48 to the mouseV
- set the castNum of sprite 47 to the number of cast "mouse U"
- set the locH of sprite 47 to -75
- set the locV of sprite 47 to 300
- set the visible of sprite 47 to 1
- cursor(200)
- rollOutMouse()
- puppetSound("drag")
- set startH to the mouseH
- set startV to the mouseV
- set finH to the locH of sprite mysprite
- set finV to the locV of sprite mysprite
- set stpH to float(finH - startH) / float(nofrs)
- set stpV to float(finV - startV) / float(nofrs)
- repeat with j = 1 to nofrs
- set the locH of sprite 48 to startH + integer(j * stpH)
- set the locV of sprite 48 to startV + integer(j * stpV)
- updateStage()
- end repeat
- set the locH of sprite 48 to finH
- set the locV of sprite 48 to finV
- updateStage()
- puppetSound(0)
- wait(60)
- set the castNum of sprite 47 to the number of cast "mouse D"
- puppetSound("switch")
- updateStage()
- wait(60)
- puppetSound("drag")
- set startH to the locH of sprite mysprite
- set startV to the locV of sprite mysprite
- set finH to myenH
- set finV to myenV
- set stpH to float(finH - startH) / float(nofrs)
- set stpV to float(finV - startV) / float(nofrs)
- repeat with j = 1 to nofrs
- set the locH of sprite 48 to startH + integer(j * stpH)
- set the locV of sprite 48 to startV + integer(j * stpV)
- set the locH of sprite mysprite to startH + integer(j * stpH)
- set the locV of sprite mysprite to startV + integer(j * stpV)
- updateStage()
- end repeat
- set the locH of sprite mysprite to myenH
- set the locV of sprite mysprite to myenV
- set the castNum of sprite 47 to the number of cast "mouse U"
- puppetSound("positive")
- updateStage()
- wait(60)
- rollBackMouse()
- set the visible of sprite 48 to 0
- set the puppet of sprite 48 to 0
- set the visible of sprite 47 to 0
- puppetSound(0)
- cursor([90, 91])
- set active to 0
- set numCorrect to numCorrect + 1
- set the moveableSprite of sprite mysprite to 0
- startEvents()
- end
-
- on rollBackMouse
- set widthOfMouse to 143
- puppetSound("FORKSTRT.AIF")
- set stH to the locH of sprite 47
- set i to stH
- repeat while i > (stH - widthOfMouse)
- set i to i - 3
- set the locH of sprite 47 to i
- updateStage()
- end repeat
- puppetSound("FORKSTOP.AIF")
- updateStage()
- repeat while soundBusy(1)
- end repeat
- puppetSound(0)
- end
-
- on rollOutMouse
- set widthOfMouse to 143
- puppetSound("FORKSTRT.AIF")
- set stH to the locH of sprite 47
- set i to stH
- repeat while i < (stH + widthOfMouse)
- set i to i + 3
- set the locH of sprite 47 to i
- updateStage()
- end repeat
- puppetSound("FORKSTOP.AIF")
- updateStage()
- repeat while soundBusy(1)
- end repeat
- puppetSound(0)
- end
-