Closed jaythebusinessgoose closed 1 year ago
So this would also benefit from a MagmamanSpawnPosition(x, y)
constructor that sets the timer to a random number using whatever limits and prng the game uses, or maybe even a function to create and add a spawn position to the vector and start the logic automatically in different themes.
We don't currently have another way to start this logic anywhere, but this works
if not state.logic.magmaman_spawn then
state.level_gen.themes[THEME.VOLCANA]:spawn_effects()
end
local x, y = math.floor(state.level_gen.spawn_x), math.floor(state.level_gen.spawn_y)
spawn_liquid(ENT_TYPE.LIQUID_LAVA, x, y)
table.insert(state.logic.magmaman_spawn.magmaman_positions, MagmamanSpawnPosition:new(x, y))
Does table.remove
also work?
Oh yeah or clearing the whole table to stop the spawns.
Hmm if I add some lava in dwelling and then call spawn_effects from volcana to start the magmaman logic, it works great and the current lava tiles are added to magmaman_positions automatically, but if I start the logic first, then spawn some lava and add the MagmamanSpawnPositions manually, the game crashes when I unload the level.