feat(game/world): add invisible walls around map

This commit is contained in:
Kazhnuz 2019-07-27 11:42:37 +02:00
parent 4bb7c3e94f
commit fb98ada7eb

View file

@ -6,4 +6,18 @@ function RadianceWorld:new(scene, maptype, mapname)
RadianceWorld.super.new(self, scene, "game.modules.world.actors", mappath, maptype) RadianceWorld.super.new(self, scene, "game.modules.world.actors", mappath, maptype)
end end
function RadianceWorld:loadMapObjects()
RadianceWorld.super.loadMapObjects(self)
self:addInvisibleWalls()
end
function RadianceWorld:addInvisibleWalls()
local w, h = self:getDimensions()
print(w, h)
self.obj.collisions["invisible"](self, 0, -16, 0, w, 16, 1000)
self.obj.collisions["invisible"](self, 0, h, 0, w, 16, 1000)
self.obj.collisions["invisible"](self, w, 0, 0, 16, h, 1000)
self.obj.collisions["invisible"](self, -16, 0, 0, 16, h, 1000)
end
return RadianceWorld return RadianceWorld