api
parent
1157a7faec
commit
8a0d5bb038
|
@ -0,0 +1,14 @@
|
|||
|
||||
-- returns true if pos occupied (with safety margin)
|
||||
planetoidgen.is_occupied = function(pos)
|
||||
for _, planet in ipairs(planetoidgen.planets) do
|
||||
local distance = vector.distance(pos, planet.pos)
|
||||
|
||||
if distance < planet.radius+500 then
|
||||
-- planet is here
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
Loading…
Reference in New Issue