1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-14 10:13:13 +02:00
RedMew/map_gen/maps/spiral_tri.lua

24 lines
602 B
Lua
Raw Normal View History

return function(x, y)
2018-11-21 15:42:39 +02:00
local distance = math.sqrt(x * x + y * y)
if distance > 128 then
local angle = (180 + math.deg(math.atan2(x, y))) * 3
2018-11-21 15:42:39 +02:00
local offset = distance * 0.75
if angle ~= 0 then
offset = offset + angle / 3.75
end
--if angle ~= 0 then offset = offset + angle /1.33333333 end
2018-11-21 15:42:39 +02:00
if offset % 96 < 48 then
local offset2 = distance * 0.125
if angle ~= 0 then
offset2 = offset2 - angle / 3.75
end
2018-11-21 15:42:39 +02:00
return offset2 % 96 >= 80
end
end
2018-11-21 15:42:39 +02:00
return true
end