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

20 lines
398 B
Lua
Raw Normal View History

2017-07-29 11:07:08 +01:00
--X shape map script --by Neko_Baron
--edit this
local tiles_wide = 128
local tiles_intersect = 384
---dont edit these
local tiles_half = tiles_wide * 0.5
2018-05-10 20:42:24 +01:00
return function(x, y)
2018-11-21 08:42:39 -05:00
local offset_1 = x + y + tiles_half
local offset_2 = x - y + tiles_half
2017-07-29 11:07:08 +01:00
2018-11-21 08:42:39 -05:00
if offset_1 % tiles_intersect > tiles_wide then
return offset_2 % tiles_intersect <= tiles_wide
end
2017-07-29 11:07:08 +01:00
2018-11-21 08:42:39 -05:00
return true
2018-05-10 20:42:24 +01:00
end