feat: add a test map based on Battle's "collosseum" map
This commit is contained in:
parent
029ede636b
commit
b3d9ed582e
6 changed files with 51 additions and 2 deletions
BIN
sonic-radiance.love/assets/backgrounds/parallax/test-back.png
Normal file
BIN
sonic-radiance.love/assets/backgrounds/parallax/test-back.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 214 B |
|
@ -16,7 +16,7 @@ function gameutils.getMapDirectory(maptype, mapname)
|
||||||
end
|
end
|
||||||
|
|
||||||
function gameutils.validateMapType(maptype)
|
function gameutils.validateMapType(maptype)
|
||||||
local types = {"battle", "sti"}
|
local types = {"battle", "sti", "test"}
|
||||||
local validated = false
|
local validated = false
|
||||||
|
|
||||||
for i, type in ipairs(types) do
|
for i, type in ipairs(types) do
|
||||||
|
|
|
@ -1,11 +1,22 @@
|
||||||
local World3D = require "core.modules.world.world3D"
|
local World3D = require "core.modules.world.world3D"
|
||||||
local RadianceWorld = World3D:extend()
|
local RadianceWorld = World3D:extend()
|
||||||
|
|
||||||
|
local customMap = require "game.modules.world.maps"
|
||||||
|
|
||||||
function RadianceWorld:new(scene, maptype, mapname)
|
function RadianceWorld:new(scene, maptype, mapname)
|
||||||
local mappath = game.utils.getMapPath(maptype, mapname)
|
local mappath = game.utils.getMapPath(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:createMapController()
|
||||||
|
if (self.maptype == "test") then
|
||||||
|
customMap.Test(self)
|
||||||
|
else
|
||||||
|
RadianceWorld.super.createMapController(self)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function RadianceWorld:loadMapObjects()
|
function RadianceWorld:loadMapObjects()
|
||||||
RadianceWorld.super.loadMapObjects(self)
|
RadianceWorld.super.loadMapObjects(self)
|
||||||
self:addInvisibleWalls()
|
self:addInvisibleWalls()
|
||||||
|
|
5
sonic-radiance.love/game/modules/world/maps/init.lua
Normal file
5
sonic-radiance.love/game/modules/world/maps/init.lua
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
local customMap = {}
|
||||||
|
|
||||||
|
customMap.Test = require "game.modules.world.maps.test"
|
||||||
|
|
||||||
|
return customMap
|
33
sonic-radiance.love/game/modules/world/maps/test.lua
Normal file
33
sonic-radiance.love/game/modules/world/maps/test.lua
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
local BaseMap = require "core.modules.world.maps.parent"
|
||||||
|
local TestMap = BaseMap:extend()
|
||||||
|
|
||||||
|
function TestMap:new(world)
|
||||||
|
TestMap.super.new(self, world)
|
||||||
|
self:setPadding(0, 96, 0, 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
function TestMap:loadCollisions()
|
||||||
|
self.world:newCollision("wall", 0, 0, -16, 8*64, 8*32, 16)
|
||||||
|
self.world:newCollision("wall", 64*1, 32*1, 0, 64*1, 32*3, 64)
|
||||||
|
self.world:newCollision("wall", 64*4, 32*1, 0, 64*3, 32*1, 64)
|
||||||
|
self.world:newCollision("wall", 64*6, 32*5, 0, 64*1, 32*3, 64)
|
||||||
|
self.world:newCollision("wall", 64*1, 32*7, 0, 64*3, 32*1, 64)
|
||||||
|
end
|
||||||
|
|
||||||
|
function TestMap:getDimensions()
|
||||||
|
return 8*64, 9*32
|
||||||
|
end
|
||||||
|
|
||||||
|
function TestMap:loadPlayers()
|
||||||
|
self.world:addPlayer(16, 16, 0, 1)
|
||||||
|
end
|
||||||
|
|
||||||
|
function TestMap:loadActors()
|
||||||
|
-- Empty Placeholder function
|
||||||
|
end
|
||||||
|
|
||||||
|
function TestMap:draw()
|
||||||
|
-- Empty Placeholder function
|
||||||
|
end
|
||||||
|
|
||||||
|
return TestMap
|
|
@ -33,7 +33,7 @@ function MovePlayer:new(playerNumber, cameraMode)
|
||||||
MovePlayer.super.new(self)
|
MovePlayer.super.new(self)
|
||||||
self.assets:batchImport("scenes.test_scene.assets")
|
self.assets:batchImport("scenes.test_scene.assets")
|
||||||
|
|
||||||
World(self, "sti", "test")
|
World(self, "test", "test")
|
||||||
|
|
||||||
self.world:setPlayerNumber(playerNumber)
|
self.world:setPlayerNumber(playerNumber)
|
||||||
self.world.cameras:setMode(cameraMode)
|
self.world.cameras:setMode(cameraMode)
|
||||||
|
|
Loading…
Reference in a new issue