1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-01-18 03:21:47 +02:00

add sine fill builder

This commit is contained in:
grilledham 2018-03-29 19:23:58 +01:00
parent 12be40d8f8
commit b8ec3e3f47

View File

@ -88,6 +88,20 @@ function oval_builder(x_radius, y_radius)
end
end
function sine_fill_builder(width, height)
width_inv = tau / width
height_inv = -2 / height
return function(x, y)
local x2 = x * width_inv
local y2 = y * height_inv
if y <= 0 then
return y2 < math.sin(x2)
else
return y2 > math.sin(x2)
end
end
end
local tile_map = {
[1] = false,
[2] = true,