feat: make possible to load all Battle maps
This commit is contained in:
parent
5d83f2ba12
commit
cf377f15b8
4 changed files with 21 additions and 9 deletions
1
sonic-radiance.love/datas/gamedata/maps/battle/init.lua
Normal file
1
sonic-radiance.love/datas/gamedata/maps/battle/init.lua
Normal file
|
@ -0,0 +1 @@
|
|||
return {"aroom", "bhighway", "crouge", "cruins", "ebeach", "ghill", "hsummit", "library", "mdepot", "tlab"}
|
|
@ -65,13 +65,18 @@ function menu.SubMenuWidget:action()
|
|||
end
|
||||
|
||||
-- SceneWidget
|
||||
function menu.SceneWidget:new(scene, menuName, newScene, newSceneName)
|
||||
function menu.SceneWidget:new(scene, menuName, newScene, newSceneName, sceneArgument)
|
||||
menu.SceneWidget.super.new(self, scene, menuName, newSceneName)
|
||||
self.newScene = newScene
|
||||
self.sceneArgument = sceneArgument
|
||||
end
|
||||
|
||||
function menu.SceneWidget:action()
|
||||
if (self.sceneArgument ~= nil) then
|
||||
self.newScene(self.sceneArgument)
|
||||
else
|
||||
self.newScene()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -62,9 +62,17 @@ end
|
|||
|
||||
function DebugMenu:buildOtherMenu()
|
||||
self:addSubMenu("other", "BaseMenu", "Other gameplay")
|
||||
menu.commons.SceneWidget(self, "other", scenes.test, "Sonic Battle Maps")
|
||||
self:addSubMenu("battle", "other", "Sonic Battle Maps")
|
||||
local mapList = require "datas.gamedata.maps.battle"
|
||||
for i, name in ipairs(mapList) do
|
||||
local mapData = require("datas.gamedata.maps.battle." .. name)
|
||||
local trueName = mapData.name
|
||||
menu.commons.SceneWidget(self, "battle", scenes.test, trueName, name)
|
||||
end
|
||||
|
||||
menu.commons.SceneWidget(self, "other", scenes.test2, "Shadow Shot Maps")
|
||||
|
||||
menu.commons.SubMenuWidget(self, "battle", "other", "Back")
|
||||
menu.commons.SubMenuWidget(self, "other", "BaseMenu", "Back")
|
||||
end
|
||||
|
||||
|
|
|
@ -26,17 +26,15 @@ local MovePlayer = Scene:extend()
|
|||
|
||||
local World = require "game.modules.world"
|
||||
|
||||
function MovePlayer:new(playerNumber, cameraMode)
|
||||
local playerNumber = playerNumber or 1
|
||||
local cameraMode = cameraMode or "split"
|
||||
function MovePlayer:new(map)
|
||||
|
||||
MovePlayer.super.new(self)
|
||||
self.assets:batchImport("scenes.test_scene.assets")
|
||||
|
||||
World(self, "battle", "tlab")
|
||||
World(self, "battle", map)
|
||||
|
||||
self.world:setPlayerNumber(playerNumber)
|
||||
self.world.cameras:setMode(cameraMode)
|
||||
self.world:setPlayerNumber(1)
|
||||
self.world.cameras:setMode("split")
|
||||
|
||||
self.world:loadMap()
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue