home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / BoxKite.dxr / Untitled-1_9_kite.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  600 b   |  26 lines

  1. property obj, spriteNum, origin, objloc, mag, dir, inc, theta, maxoff, rot
  2.  
  3. on beginSprite me
  4.   obj = sprite(spriteNum)
  5.   origin = [obj.locH.float, obj.locV.float]
  6.   dir = 0
  7.   theta = 0
  8.   rot = random(5, 10)
  9.   mag = 20
  10.   inc = random(-2, 2)
  11.   maxoff = random(50, 75)
  12. end
  13.  
  14. on enterFrame me
  15.   if abs(origin[1] - inc) >= maxoff then
  16.     inc = -inc
  17.   end if
  18.   origin = origin + [inc, 0]
  19.   obj.rotation = obj.rotation + random(-5, 5)
  20.   theta = theta + rot
  21.   newX = cos(theta * PI / 180) * 50
  22.   newY = sin(theta * PI / 180) * 20
  23.   objloc = origin + [newX, newY]
  24.   obj.loc = point(objloc[1], objloc[2])
  25. end
  26.