sonic-radiance/sonic-radiance.love/game/modules/world/init.lua

35 lines
1 KiB
Lua

local World3D = require "core.modules.world.world3D"
local RadianceWorld = World3D:extend()
local customMap = require "game.modules.world.maps"
function RadianceWorld:new(scene, maptype, mapname)
local mappath = game.utils.getMapPath(maptype, mapname)
RadianceWorld.super.new(self, scene, "game.modules.world.actors", mappath, maptype)
end
function RadianceWorld:createMapController()
if (self.maptype == "test") then
customMap.Test(self)
else
RadianceWorld.super.createMapController(self)
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