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

  1. on holein a, b
  2.   global d, lh, lv, holeout
  3.   updateStage()
  4.   puppetSound("holein")
  5.   set the constraint of sprite (a + 7) to 0
  6.   set the locH of sprite (a + 7) to 0
  7.   set the locV of sprite (a + 7) to 0
  8.   set the castNum of sprite (a + 7) to 0
  9.   updateStage()
  10.   setAt(d, a, 0)
  11.   if (a <> 5) and (a <> b) then
  12.     repeat with k = 3 to 7
  13.       set c to 0
  14.       set rectk to rect(the locH of sprite k - 8, the locV of sprite k - 8, the locH of sprite k + 8, the locV of sprite k + 8)
  15.       repeat with j = 1 to 5
  16.         if intersect(the rect of sprite (j + 7), rectk) <> rect(0, 0, 0, 0) then
  17.           set c to 1
  18.           exit repeat
  19.         end if
  20.       end repeat
  21.       if c = 0 then
  22.         set the locH of sprite (a + 7) to the locH of sprite k
  23.         set the locV of sprite (a + 7) to the locV of sprite k
  24.         setAt(lh, a, the locH of sprite k)
  25.         setAt(lv, a, the locV of sprite k)
  26.         set the constraint of sprite (a + 7) to 1
  27.         set the castNum of sprite (a + 7) to a + 6
  28.         exit repeat
  29.       end if
  30.     end repeat
  31.   else
  32.     if a = b then
  33.       add(holeout, a + 7)
  34.     end if
  35.   end if
  36. end
  37.  
  38. on wait p
  39.   set nt to ticks()
  40.   set et to nt + p
  41.   repeat while nt < et
  42.     set nt to ticks()
  43.   end repeat
  44. end
  45.