home *** CD-ROM | disk | FTP | other *** search
- property ancestor, animCounter, myName, mySound, myTargetGraphic, rollLock, myTarget, myMovie
- global gGoFlag
-
- on new me, type, myPos, whichSound, whichTargetG, whichMovie
- set ancestor to new(script "spriteGenerator")
- set myName to the memberNum of member type
- set myTargetGraphic to whichTargetG
- set myMovie to whichMovie
- set mySound to whichSound
- set animCounter to 0
- set rollLock to 0
- append(the actorList, me)
- appear(me, myPos, type, 255, 0, 8)
- return me
- end
-
- on stepFrame me
- if rollOver(the spriteNum of me) and the mouseUp and (rollLock = 0) then
- set rollLock to 1
- rollRoutine(me)
- else
- if rollOver(the spriteNum of me) and the mouseDown and (rollLock = 0) then
- set rollLock to 0
- rollRoutine(me)
- else
- if rollOver(the spriteNum of me) and the mouseDown and (rollLock = 1) and not gGoFlag then
- set gGoFlag to 1
- if objectp(myTarget) then
- destroy(myTarget)
- set myTarget to 0
- end if
- explode(me, myName + 60)
- else
- if not rollOver(the spriteNum of me) then
- set rollLock to 0
- if objectp(myTarget) then
- destroy(myTarget)
- set myTarget to 0
- end if
- animateRock(me, 0)
- else
- rollRoutine(me)
- end if
- end if
- end if
- end if
- end
-
- on rollRoutine me
- if not objectp(myTarget) then
- set myTarget to new(script "targetScript", myTargetGraphic)
- end if
- animateRock(me, 30)
- end
-
- on animateRock me, deficit
- set animCounter to animCounter + 1
- if animCounter > 29 then
- set animCounter to 0
- end if
- set myMemberNum to myName + animCounter + deficit
- set the memberNum of sprite the spriteNum of me to myMemberNum
- end
-
- on explode me, member
- set startposition to the loc of sprite the spriteNum of me
- destroy(me)
- playSound(2, mySound)
- set explosion to new(script "explosionScript", member, 20, myMovie)
- appear(explosion, startposition, member, 255, 0, 8)
- end
-