home *** CD-ROM | disk | FTP | other *** search
/ Seeker / Seeker.iso / files_w / 5balls.dir / 00055.ls < prev    next >
Encoding:
Text File  |  1994-12-05  |  738 b   |  27 lines

  1. on getPos p
  2.   global lh, lv, ballrect
  3.   set q to 0
  4.   repeat while q = 0
  5.     set randomh to random(340) + 150
  6.     set randomv to random(190) + 145
  7.     set randompoint to point(randomh, randomv)
  8.     repeat with j = 1 to 5
  9.       if getAt(ballrect, j) = [] then
  10.         set q to 1
  11.         exit repeat
  12.         next repeat
  13.       end if
  14.       if inside(randompoint, getAt(ballrect, j)) = 1 then
  15.         exit repeat
  16.       end if
  17.     end repeat
  18.   end repeat
  19.   set randomrect to rect(randomh - 20, randomv - 20, randomh + 20, randomv + 20)
  20.   setAt(ballrect, p - 7, randomrect)
  21.   add(lh, float(randomh))
  22.   add(lv, float(randomv))
  23.   set the locH of sprite p to randomh
  24.   set the locV of sprite p to randomv
  25.   set the castNum of sprite p to p - 1
  26. end
  27.