home *** CD-ROM | disk | FTP | other *** search
- property x, y, xVel, yVel, myChan, myFirstCast, myCurrentCast
-
- on birth me, chan
- set myChan to chan
- puppetSprite(myChan, 1)
- set the stretch of sprite myChan to 0
- set the castNum of sprite myChan to 0
- return me
- end
-
- on startAnimation me
- set the foreColor of sprite myChan to 0
- set myFirstCast to (random(4) * 4) + 47
- set myCurrentCast to myFirstCast
- set x to the mouseH - 5
- set y to the mouseV - 5
- set yVel to -7 - random(10)
- set xVel to -random(10) - 5
- end
-
- on display me
- set the locH of sprite myChan to x
- set the locV of sprite myChan to y
- set the castNum of sprite myChan to myCurrentCast
- end
-
- on Animate me
- global theCoord
- display(me)
- if random(3) > 1 then
- set myCurrentCast to myCurrentCast + 1
- end if
- if (the castNum of sprite myChan - myFirstCast) > 3 then
- set the castNum of sprite myChan to 0
- removeBub(theCoord, me)
- else
- set x to x + xVel
- set y to y + yVel
- set yVel to yVel + 7
- end if
- end
-