mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-02-21 19:20:07 +02:00
added cross made by neko
This commit is contained in:
parent
faab85c865
commit
a9f794711e
29
locale/gen_shape/cross.lua
Normal file
29
locale/gen_shape/cross.lua
Normal file
@ -0,0 +1,29 @@
|
||||
--X shape map script --by Neko_Baron
|
||||
|
||||
--edit this
|
||||
local tiles_wide = 172
|
||||
|
||||
---dont edit these
|
||||
local tiles_half = tiles_wide * 0.5
|
||||
|
||||
function run_shape_module(event)
|
||||
local area = event.area
|
||||
local surface = event.surface
|
||||
local tiles = {}
|
||||
|
||||
top_left = area.left_top --make a more direct reference
|
||||
|
||||
for x = top_left.x-1, top_left.x + 32 do
|
||||
for y = top_left.y-1, top_left.y + 32 do
|
||||
|
||||
local abs_x = math.abs(x)
|
||||
local abs_y = math.abs(y)
|
||||
if abs_x < abs_y - tiles_half or abs_x > abs_y + tiles_half then
|
||||
table.insert(tiles, {name = "out-of-map", position = {x,y}})
|
||||
end
|
||||
end
|
||||
end
|
||||
surface.set_tiles(tiles)
|
||||
|
||||
return true
|
||||
end
|
@ -1,7 +1,7 @@
|
||||
--[[
|
||||
This file is used to choose which styles you want.
|
||||
You may choose up to one of each type shapes, terrain, ores and misc by removing uncommenting the line.
|
||||
If you want to add your own module, just add it to the others
|
||||
If you want to add your own module, just add it to the others
|
||||
in this file and your run_*type*_module(event) function will be called.
|
||||
--]]
|
||||
|
||||
@ -15,6 +15,7 @@ in this file and your run_*type*_module(event) function will be called.
|
||||
--require "locale.gen_shape.spiral2"
|
||||
--require "locale.gen_shape.donut"
|
||||
--require "locale.gen_shape.rectangular_spiral"
|
||||
--require "locale.gen_shape.cross"
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user