mirror of
https://github.com/Refactorio/RedMew.git
synced 2024-12-12 10:04:40 +02:00
updated worms to call using string
This commit is contained in:
parent
0d840b6e14
commit
735c6b718a
@ -6,8 +6,8 @@ local medium_worm_spawn_distance = 150
|
||||
local big_worm_spawn_distance = 200
|
||||
|
||||
|
||||
local worm_names = {"small-worm-turret","medium-worm-turret","big-worm-turret"}
|
||||
local function spawn_worm(params)
|
||||
worm_names = {"small-worm-turret","medium-worm-turret","big-worm-turret"}
|
||||
function spawn_worm(params)
|
||||
local x = params.x
|
||||
local y = params.y
|
||||
local lvl = params.lvl
|
||||
@ -21,16 +21,14 @@ end
|
||||
|
||||
|
||||
function run_terrain_module(event)
|
||||
game.print(game.tick)
|
||||
local top_left = event.area.left_top
|
||||
local distance = math.sqrt(top_left.x*top_left.x+top_left.y*top_left.y)
|
||||
if distance > small_worm_spawn_distance - 32 then
|
||||
local lvl = 1
|
||||
if distance > medium_worm_spawn_distance then lvl = 2 end
|
||||
if distance > big_worm_spawn_distance then lvl = 3 end
|
||||
local worm_positions = {}
|
||||
for i = 1, worms_per_chunk do
|
||||
Thread.queue_action(spawn_worm, {x = top_left.x + math.random(0, 31), y = top_left.y + math.random(0, 31), lvl = lvl})
|
||||
Thread.queue_action("spawn_worm", {x = top_left.x + math.random(0, 31), y = top_left.y + math.random(0, 31), lvl = lvl})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user