1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-16 10:19:27 +02:00
RedMew/map_gen/maps/ring_of_balls.lua

75 lines
2.0 KiB
Lua
Raw Normal View History

-- luacheck: ignore
-- please remove luacheck ignore when map is complete/functional
2018-05-08 22:23:07 +02:00
local b = require "map_gen.shared.builders"
2018-11-06 14:08:33 +02:00
local degrees = require "utils.math".degrees
2018-01-21 17:30:42 +02:00
2018-05-08 22:23:07 +02:00
local ball = b.circle(16)
2018-01-21 17:30:42 +02:00
2018-05-08 22:23:07 +02:00
local arm = b.rectangle(2, 13)
local arm1 = b.translate(arm, 0, -19.5)
local arm2 = b.translate(arm, 0, 22)
local arm3 = b.rectangle(2, 19)
arm3 = b.rotate(arm3, degrees(-30))
arm3 = b.translate(arm3, -12, 22)
2018-01-21 17:30:42 +02:00
2018-05-08 22:23:07 +02:00
ball = b.any{ball, arm1, arm2, arm3}
ball = b.translate(ball, 0, -28)
2018-01-21 17:30:42 +02:00
2018-05-08 22:23:07 +02:00
local balls = b.any{ball, b.rotate(ball, degrees(120)), b.rotate(ball, degrees(240))}
2018-01-21 17:30:42 +02:00
2018-05-08 22:23:07 +02:00
local small_circle = b.circle(48)
local big_circle = b.circle(54)
local ring = b.all{big_circle, b.invert(small_circle)}
2018-01-21 17:30:42 +02:00
2018-05-08 22:23:07 +02:00
local big_ball = b.any{balls, ring}
2018-01-21 17:30:42 +02:00
2018-05-08 22:23:07 +02:00
local big_arm1 = b.rectangle(6.75, 42.5)
big_arm1 = b.translate(big_arm1, 0, -74.25)
--local big_arm2 = b.rectangle(24, 242)
--big_arm2 = b.translate(big_arm2, 0, 174)
2018-01-21 17:30:42 +02:00
2018-05-08 22:23:07 +02:00
big_ball = b.any{big_ball, big_arm1, big_arm2}
big_ball = b.rotate(big_ball, degrees(-90))
big_ball = b.rotate(big_ball, math.atan2(54,210))
big_ball = b.translate(big_ball, 210, -54)
2018-01-21 17:30:42 +02:00
local big_balls = {}
local count = 12
local angle = 360 / count
local offset = (180 / count) + 90
for i = 0, count - 1 do
2018-05-08 22:23:07 +02:00
local s =b.rotate(big_ball, degrees(i * angle ))
2018-01-21 17:30:42 +02:00
table.insert(big_balls, s)
end
2018-05-08 22:23:07 +02:00
local big_balls = b.segment_pattern(big_balls)
2018-01-21 17:30:42 +02:00
2018-05-08 22:23:07 +02:00
local small_circle = b.circle(304.5)
local big_circle = b.circle(316.5) --342.5625
local ring = b.all{big_circle, b.invert(small_circle)}
2018-01-21 17:30:42 +02:00
2018-05-08 22:23:07 +02:00
local map = b.any{big_balls, ring}
2018-01-21 17:30:42 +02:00
2018-05-08 22:23:07 +02:00
local leg = b.rectangle(32,480)
local head = b.translate (b.oval(32, 64), 0, -64)
local body = b.translate (b.circle(64), 0, 64)
2018-01-21 17:30:42 +02:00
local count = 10
local angle = 360 / count
local list = { head, body }
for i = 1, (count / 2) - 1 do
2018-05-08 22:23:07 +02:00
local shape = b.rotate(leg, degrees(i * angle))
2018-01-21 17:30:42 +02:00
table.insert( list, shape )
2018-11-06 14:08:33 +02:00
end
2018-01-21 17:30:42 +02:00
2018-11-06 14:08:33 +02:00
local spider = b.any(list)
2018-05-08 22:23:07 +02:00
spider = b.scale(spider,.75,.75)
2018-01-21 17:30:42 +02:00
2018-05-08 22:23:07 +02:00
--map = b.any{map, spider}
map = b.translate(map, -30, 201)
map = b.scale(map, 12, 12)
2018-01-21 17:30:42 +02:00
2018-11-06 14:08:33 +02:00
return map