home *** CD-ROM | disk | FTP | other *** search
- property myChan, maxFrames, currFrame, castList, animating, firstAnimation
-
- on birth me, chan
- set firstAnimation to 1
- set the castList of me to [576, 575, 574, 573, 572, 571]
- set myChan to chan
- set the stretch of sprite myChan to 0
- set animating to 0
- set the maxFrames of me to count(castList)
- return me
- end
-
- on startAnimation me
- global theCoord
- set loc to getProp(the layout of theCoord, #crystalroom)
- set x to getAt(loc, 1)
- set y to getAt(loc, 2)
- set the locH of sprite the myChan of me to x
- set the locV of sprite the myChan of me to y
- set currFrame to 1
- end
-
- on Animate me
- global theCoord
- if animating then
- if currFrame <= maxFrames then
- set castIndex to getAt(castList, currFrame)
- set the castNum of sprite myChan to castIndex
- else
- set the castNum of sprite myChan to 571
- set animating to 0
- end if
- set currFrame to currFrame + 1
- else
- set the castNum of sprite myChan to 571
- if firstAnimation then
- set rand to 1
- set firstAnimation to 0
- else
- set rand to random(30)
- end if
- if rand = 1 then
- set animating to 1
- startAnimation(me)
- end if
- end if
- if not (the cursorHidden of theCoord) then
- if ((the mouseCast > 570) and (the mouseCast <= 577)) or (the mouseCast = 38) or the inHelp of theCoord then
- set the castNum of sprite myChan to 577
- end if
- else
- if the inHelp of theCoord then
- set the castNum of sprite myChan to 577
- end if
- end if
- end
-