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

  1. on moveball p
  2.   global moveend, d, x, y, lh, lv
  3.   set lhkeep to the locH of sprite (p + 7)
  4.   set lvkeep to the locV of sprite (p + 7)
  5.   if lhkeep <= 136 then
  6.     if lvkeep <= 131 then
  7.       holein(p, 1)
  8.     else
  9.       if lvkeep >= 349 then
  10.         holein(p, 2)
  11.       end if
  12.     end if
  13.   else
  14.     if lhkeep >= 504 then
  15.       if lvkeep <= 131 then
  16.         holein(p, 3)
  17.       else
  18.         if lvkeep >= 349 then
  19.           holein(p, 4)
  20.         end if
  21.       end if
  22.     end if
  23.   end if
  24.   set md to getAt(d, p)
  25.   if md > 0 then
  26.     set mx to getAt(x, p)
  27.     set my to getAt(y, p)
  28.     set mlh to getAt(lh, p) + (md * mx)
  29.     set mlv to getAt(lv, p) + (md * my)
  30.     if ((mlh < 120) or (mlh > 520)) and (abs(mx * md) > 1) then
  31.       puppetSound("clash")
  32.       set mx to mx * -1
  33.       set mlh to constrainH(1, mlh)
  34.     end if
  35.     if ((mlv < 115) or (mlv > 365)) and (abs(my * md) > 1) then
  36.       puppetSound("clash")
  37.       set my to my * -1
  38.       set mlv to constrainV(1, mlv)
  39.     end if
  40.     set md to md - 0.07999999999999999
  41.     if md < 0.09999999999999999 then
  42.       set md to 0
  43.     end if
  44.     set the locH of sprite (p + 7) to mlh
  45.     set the locV of sprite (p + 7) to mlv
  46.     setAt(d, p, md)
  47.     setAt(x, p, mx)
  48.     setAt(y, p, my)
  49.     setAt(lh, p, mlh)
  50.     setAt(lv, p, mlv)
  51.   end if
  52.   if md > 0 then
  53.     set moveend to 1
  54.   else
  55.     setAt(x, p, 0)
  56.     setAt(y, p, 0)
  57.   end if
  58. end
  59.