feat: add a test map based on Battle's "collosseum" map

This commit is contained in:
Kazhnuz 2019-07-27 13:32:11 +02:00
parent 029ede636b
commit b3d9ed582e
6 changed files with 51 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

View file

@ -16,7 +16,7 @@ function gameutils.getMapDirectory(maptype, mapname)
end
function gameutils.validateMapType(maptype)
local types = {"battle", "sti"}
local types = {"battle", "sti", "test"}
local validated = false
for i, type in ipairs(types) do

View file

@ -1,11 +1,22 @@
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()

View file

@ -0,0 +1,5 @@
local customMap = {}
customMap.Test = require "game.modules.world.maps.test"
return customMap

View 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

View file

@ -33,7 +33,7 @@ function MovePlayer:new(playerNumber, cameraMode)
MovePlayer.super.new(self)
self.assets:batchImport("scenes.test_scene.assets")
World(self, "sti", "test")
World(self, "test", "test")
self.world:setPlayerNumber(playerNumber)
self.world.cameras:setMode(cameraMode)