feat: initial loading of mission files
This commit is contained in:
parent
5d46f54e99
commit
759d0d24e0
3 changed files with 15 additions and 2 deletions
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
description="Test the world",
|
||||
music="1-01- Beyond The Speed Of.mp3",
|
||||
maptype="shoot",
|
||||
map="testlevel.test1",
|
||||
}
|
|
@ -5,12 +5,13 @@ local PauseMenu = require("game.modules.playstyle.pause")
|
|||
local TestWorld = require("game.modules.world.parent")
|
||||
|
||||
|
||||
function PlayStyle:new(playerList)
|
||||
function PlayStyle:new(supportedLevels, missionfile, playerList)
|
||||
local playerList = playerList or {"sonic"}
|
||||
|
||||
PlayStyle.super.new(self)
|
||||
self.timer = 0
|
||||
self.assets:batchImport("game.modules.playstyle.assets")
|
||||
self:loadMissionFile(supportedLevels, missionfile)
|
||||
|
||||
PauseMenu(self)
|
||||
|
||||
|
@ -21,6 +22,11 @@ function PlayStyle:new(playerList)
|
|||
self:startLevel()
|
||||
end
|
||||
|
||||
function PlayStyle:loadMissionFile(supportedLevels, missionfile)
|
||||
self.mission = require("datas.gamedata.missions." .. missionfile)
|
||||
self.assets:setMusic("assets/music/" .. self.mission.music)
|
||||
end
|
||||
|
||||
function PlayStyle:initWorld()
|
||||
TestWorld(self)
|
||||
end
|
||||
|
@ -73,6 +79,7 @@ end
|
|||
|
||||
function PlayStyle:startLevel()
|
||||
self.world:loadMap()
|
||||
self.assets:playMusic()
|
||||
end
|
||||
|
||||
function PlayStyle:restartLevel()
|
||||
|
|
|
@ -29,7 +29,7 @@ local ShootWorld = require "game.modules.world.shoot"
|
|||
local BattleWorld = require "game.modules.world.battle"
|
||||
|
||||
function MovePlayer:new()
|
||||
MovePlayer.super.new(self, {"sonic"})
|
||||
MovePlayer.super.new(self, {"shoot", "test", "battle"}, "testmissions", {"sonic"})
|
||||
end
|
||||
|
||||
function MovePlayer:initWorld()
|
||||
|
|
Loading…
Reference in a new issue