home *** CD-ROM | disk | FTP | other *** search
- property myChan1, myChan2, maxFrames, currFrame, cast1List, cast2List, animating, var
-
- on birth me, chan1, chan2
- set myChan1 to chan1
- set myChan2 to chan2
- set the stretch of sprite myChan1 to 0
- set the stretch of sprite myChan2 to 0
- set animating to 0
- return me
- end
-
- on startAnimation me
- set rand to 1
- if rand = 1 then
- set var to 3
- do("var" & var & " me")
- else
- set var to random(2)
- do("var" & var & " me")
- end if
- set currFrame to 1
- end
-
- on var1 me
- set cast1List to [68, 69, 70, 68, 70, 69, 68, 68, 68, 68, 69, 68, 70, 69, 70, 68, 68, 68, 68, 68, 68]
- set cast2List to [0, 72, 73, 74, 75, 76, 72, 73, 74, 75, 76, 0, 72, 73, 74, 72, 73, 74, 75, 76, 0]
- set maxFrames to 21
- set the locH of sprite myChan1 to 502
- set the locV of sprite myChan1 to 80
- set the locH of sprite myChan2 to 464
- set the locV of sprite myChan2 to 84
- end
-
- on var2 me
- set cast1List to [68, 69, 71, 69, 67, 69, 68, 68, 68, 68, 68, 68]
- set cast2List to [0, 0, 72, 73, 74, 75, 76, 0, 0, 0, 0, 0]
- set maxFrames to 12
- set the locH of sprite myChan1 to 502
- set the locV of sprite myChan1 to 80
- set the locH of sprite myChan2 to 460
- set the locV of sprite myChan2 to 84
- end
-
- on var3 me
- set cast1List to [225, 225, 225, 225, 225, 225, 225, 225, 225, 225]
- set cast2List to [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
- set maxFrames to 10
- set the locH of sprite myChan1 to 497
- set the locV of sprite myChan1 to 52
- end
-
- on Animate me
- global theCoord
- if animating then
- if currFrame <= maxFrames then
- put currFrame
- if var = 3 then
- set the locH of sprite myChan1 to 497
- set the locV of sprite myChan1 to 52
- set the castNum of sprite myChan1 to 225
- else
- set the locH of sprite myChan1 to 502
- set the locV of sprite myChan1 to 80
- set the locH of sprite myChan2 to 464
- set the locV of sprite myChan2 to 84
- set cast1Index to getAt(cast1List, currFrame)
- set the castNum of sprite myChan1 to cast1Index
- end if
- set cast2Index to getAt(cast2List, currFrame)
- put the castNum of sprite myChan1
- set the castNum of sprite myChan2 to cast2Index
- else
- set the locH of sprite myChan1 to 502
- set the locV of sprite myChan1 to 80
- set the castNum of sprite myChan1 to 68
- set the castNum of sprite myChan2 to 0
- set animating to 0
- end if
- set currFrame to currFrame + 1
- else
- set the locH of sprite myChan1 to 502
- set the locV of sprite myChan1 to 80
- set the castNum of sprite myChan1 to 68
- if random(30) = 1 then
- set animating to 1
- startAnimation(me)
- end if
- end if
- if not (the cursorHidden of theCoord) then
- if ((the mouseCast > 66) and (the mouseCast < 72)) or (the mouseCast = 225) then
- set the locH of sprite myChan1 to 497
- set the locV of sprite myChan1 to 52
- set the castNum of sprite myChan1 to 225
- set the castNum of sprite myChan2 to 0
- end if
- end if
- end
-