home *** CD-ROM | disk | FTP | other *** search
- on getPos p
- global lh, lv, ballrect
- set q to 0
- repeat while q = 0
- set randomh to random(340) + 150
- set randomv to random(190) + 145
- set randompoint to point(randomh, randomv)
- repeat with j = 1 to 5
- if getAt(ballrect, j) = [] then
- set q to 1
- exit repeat
- next repeat
- end if
- if inside(randompoint, getAt(ballrect, j)) = 1 then
- exit repeat
- end if
- end repeat
- end repeat
- set randomrect to rect(randomh - 20, randomv - 20, randomh + 20, randomv + 20)
- setAt(ballrect, p - 7, randomrect)
- add(lh, float(randomh))
- add(lv, float(randomv))
- set the locH of sprite p to randomh
- set the locV of sprite p to randomv
- set the castNum of sprite p to p - 1
- end
-