How can I reset Wall Sprites for another level?
I use gfx.sprite.addWallSprites(tilemap, {1,2})
to set Wall Sprites for level x. When I do the same for level y, the wall sprites for level x do not get removed. How can I achieve this?
The whole function looks like this
function createMap()
local currentMap = rld(levels[level].map)
tilemap:setTiles(currentMap, columnCount)
sprite:setBounds(0,0,sprite:getSize())
sprite:setTilemap(tilemap)
sprite:setZIndex(0)
-- TODO: Figure out resetting the wall sprites
gfx.sprite.addWallSprites(tilemap, {1,2})
map = sprite
levelTiles = tilemap
end
I can't find a function to remove wall sprites in the docs.
I use macOS as operating system. Here are screenshots of the first three levels:
Level 1
Level 2
Level3
Cheers,
Mario