home *** CD-ROM | disk | FTP | other *** search
- property obj, spriteNum, origin, objloc, mag, dir, inc, theta, maxoff, rot
-
- on beginSprite me
- obj = sprite(spriteNum)
- origin = [obj.locH.float, obj.locV.float]
- dir = 0
- theta = 0
- rot = random(5, 10)
- mag = 20
- inc = random(-2, 2)
- maxoff = random(50, 75)
- end
-
- on enterFrame me
- if abs(origin[1] - inc) >= maxoff then
- inc = -inc
- end if
- origin = origin + [inc, 0]
- obj.rotation = obj.rotation + random(-5, 5)
- theta = theta + rot
- newX = cos(theta * PI / 180) * 50
- newY = sin(theta * PI / 180) * 20
- objloc = origin + [newX, newY]
- obj.loc = point(objloc[1], objloc[2])
- end
-