From 7b684200277f1131f3b79f1caa347c823ef88919 Mon Sep 17 00:00:00 2001 From: Simon Kellet Date: Sun, 21 Jul 2024 19:47:18 +0100 Subject: [PATCH] maps now clear their Wall tables before making new ones --- mapsloader.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mapsloader.lua b/mapsloader.lua index d29c1d6..673c468 100644 --- a/mapsloader.lua +++ b/mapsloader.lua @@ -1,10 +1,12 @@ -function loadMap(lvl) +function LoadMap(lvl) + ClearWalls() + local mapfilelocation = "maps/" local extention = ".lua" local mapname = mapfilelocation .. "map" .. lvl .. extention GameMap = STI(mapname) - Walls = {} + --Walls = {} if GameMap.layers["Walls"] then for _, obj in ipairs(GameMap.layers["Walls"].objects) do local wall = World:newRectangleCollider(obj.x, obj.y, obj.width, obj.height)