home *** CD-ROM | disk | FTP | other *** search
- property ufo, spriteNum, ogLoc, newloc, motion, vanish, direc, di
-
- on beginSprite me
- ufo = sprite(spriteNum)
- ufo.blend = 0
- ogLoc = ufo.loc
- di = [1, -1]
- direc = di[random(di.count)]
- newloc = ogLoc + point(150 * direc, 0)
- puppetSound(4, member("beamer"))
- vanish = timeout("lll").new(10, #reapp, me)
- end
-
- on reapp me
- if ufo.blend < 100 then
- ufo.blend = ufo.blend + 1
- else
- vanish.forget()
- motion = timeout(string(the ticks)).new(10, #moveit, me)
- end if
- end
-
- on moveit me
- if ufo.loc <> newloc then
- ufo.loc = ufo.loc + point(direc, 0)
- else
- motion.forget()
- vanish = timeout(string(the ticks)).new(10, #disapp, me)
- end if
- end
-
- on disapp me
- if ufo.blend > 0 then
- ufo.blend = ufo.blend - 1
- else
- vanish.forget()
- ufo.loc = point(random(the stageRight - 50 - (the stageLeft + 50)), random(the stageBottom - 50 - (the stageTop + 50)))
- direc = di[random(di.count)]
- ogLoc = ufo.loc
- newloc = ogLoc + point((random(100) + 100) * direc, 0)
- puppetSound(4, member("beamer"))
- vanish = timeout(string(the ticks)).new(10, #reapp, me)
- end if
- end
-