Making a spawner is actually reeeeally easy. I made a spawner system for future SMBX2 versions recently and it only is like 50 lines per spawner. Fundamentally speaking you can take this code and just change the spawn location, speeds and npc id by tweaking some numbers. For something volcanic, the reznor or ludwig fireball could be a good vanilla option.
Code: Select all
local cams = {{enabled = true, timer = 0, delay = 200}, {enabled = true, timer = 0, delay = 200}}
function onTickEnd()
if Defines.levelFreeze then return end
for k,v in ipairs(Camera.get()) do
local c = cams[v.idx]
if c.enabled then
c.timer = c.timer + 1
if c.timer % c.delay == 0 then
local y = v.y
local p = Player.getNearest(v.x + 0.5 * v.width, v.y + 0.5 * v.height)
local n = NPC.spawn(282, v.x + RNG.random(0, 800), y, p.section, false, true)
n.speedY = 4
n.layerName = "Spawned NPCs"
end
end
end
end