home *** CD-ROM | disk | FTP | other *** search
/ Seeker / Seeker.iso / files_w / 5balls.dir / 00044.ls < prev    next >
Encoding:
Text File  |  1994-12-05  |  1.4 KB  |  51 lines

  1. on exitFrame
  2.   global h12, v12, x, y, d
  3.   repeat while the stillDown
  4.     set mousehkeep to mouseH()
  5.     set mousevkeep to mouseV()
  6.     set mousex to float(mousehkeep - h12)
  7.     set mousey to float(mousevkeep - v12)
  8.     set mousexy to sqrt((mousex * mousex) + (mousey * mousey))
  9.     if abs(mousex) > 0 then
  10.       set radian to atan(mousey / mousex)
  11.       if mousex < 0 then
  12.         set radian to radian + PI
  13.       end if
  14.     else
  15.       if mousey > 0 then
  16.         set radian to PI / 2
  17.       else
  18.         set radian to -(PI / 2)
  19.       end if
  20.     end if
  21.     if mousexy > 36 then
  22.       set the locH of sprite 13 to h12 + (cos(radian) * 36)
  23.       set the locV of sprite 13 to v12 + (sin(radian) * 36)
  24.       set the castNum of sprite 13 to 32
  25.     else
  26.       set the locH of sprite 13 to h12 + (cos(radian) * mousexy)
  27.       set the locV of sprite 13 to v12 + (sin(radian) * mousexy)
  28.       set the castNum of sprite 13 to 20 + (mousexy / 3)
  29.     end if
  30.     updateStage()
  31.   end repeat
  32.   set dh to float(the locH of sprite 13 - the locH of sprite 12)
  33.   set dv to float(the locV of sprite 13 - the locV of sprite 12)
  34.   if abs(dh) > 0 then
  35.     set radian to atan(dv / dh)
  36.     if dh < 0 then
  37.       set radian to radian + PI
  38.     end if
  39.   else
  40.     if dv > 0 then
  41.       set radian to PI / 2
  42.     else
  43.       set radian to -(PI / 2)
  44.     end if
  45.   end if
  46.   setAt(x, 5, cos(radian))
  47.   setAt(y, 5, sin(radian))
  48.   setAt(d, 5, the castNum of sprite 13 - 20)
  49.   set the castNum of sprite 13 to 0
  50. end
  51.