feat: add a parent scene class for the game
This commit is contained in:
parent
9ff9a53d2a
commit
7218b7892e
12 changed files with 22 additions and 25 deletions
|
@ -1,14 +1,12 @@
|
|||
local Scene = require("birb.modules.scenes")
|
||||
local Scene = require("game.scenes")
|
||||
local PlayStyle = Scene:extend()
|
||||
|
||||
local PauseMenu = require("game.modules.subgames.pause")
|
||||
local TestWorld = require("game.modules.subgames.world.parent")
|
||||
|
||||
function PlayStyle:new(supportedLevels, missionfile)
|
||||
|
||||
PlayStyle.super.new(self)
|
||||
self.timer = 0
|
||||
self.assets:batchImport("assets.commons")
|
||||
self.assets:batchImport("assets.subgames")
|
||||
--self:loadMissionFile(supportedLevels, missionfile)
|
||||
|
||||
|
|
13
sonic-radiance.love/game/scenes/init.lua
Normal file
13
sonic-radiance.love/game/scenes/init.lua
Normal file
|
@ -0,0 +1,13 @@
|
|||
local BirbScene = require "birb.modules.scenes"
|
||||
local RadianceScene = BirbScene:extend()
|
||||
|
||||
function RadianceScene:new()
|
||||
RadianceScene.super.new(self)
|
||||
|
||||
-- Importation Global des assets
|
||||
self.assets:batchImport("assets.commons")
|
||||
self.assets.fonts["small"]:setLineHeight(16/18)
|
||||
self.assets.fonts["small"]:setFilter("shadow")
|
||||
end
|
||||
|
||||
return RadianceScene
|
|
@ -1,4 +1,4 @@
|
|||
local Scene = require "birb.modules.scenes"
|
||||
local Scene = require "game.scenes"
|
||||
|
||||
local BattleSystem = Scene:extend()
|
||||
|
||||
|
@ -14,7 +14,6 @@ local TweenManager = require "birb.classes.time"
|
|||
function BattleSystem:new(battleData)
|
||||
BattleSystem.super.new(self)
|
||||
|
||||
self.assets:batchImport("assets.commons")
|
||||
self.assets:batchImport("assets.battle")
|
||||
|
||||
self:playMusic(battleData.music)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
local Scene = require "birb.modules.scenes"
|
||||
local Scene = require "game.scenes"
|
||||
local menu = require "scenes.menus.debugmenus.animation.menu"
|
||||
|
||||
local CharAnimViewer = Scene:extend()
|
||||
|
@ -8,7 +8,6 @@ local Sprite = require "birb.modules.assets.types.sprites"
|
|||
|
||||
function CharAnimViewer:new()
|
||||
CharAnimViewer.super.new(self)
|
||||
self.assets:batchImport("assets.commons")
|
||||
self.assets:batchImport("assets.debug")
|
||||
local mainMenu = menu.commons.DebugMenu(self, "MainMenu")
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
local Scene = require "birb.modules.scenes"
|
||||
local Scene = require "game.scenes"
|
||||
local menu = require "scenes.menus.debugmenus.battleBack.menu"
|
||||
|
||||
local BackgroundViewer = Scene:extend()
|
||||
|
@ -8,7 +8,6 @@ local backgroundList = require "datas.gamedata.maps.shoot.zones"
|
|||
|
||||
function BackgroundViewer:new()
|
||||
BackgroundViewer.super.new(self)
|
||||
self.assets:batchImport("assets.commons")
|
||||
self.assets:batchImport("assets.debug")
|
||||
menu.commons.DebugMenu(self, "MainMenu")
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
local Scene = require "birb.modules.scenes"
|
||||
local Scene = require "game.scenes"
|
||||
local menu = require "scenes.menus.debugmenus.choregraphy.menu"
|
||||
|
||||
local ChoregraphyViewer = Scene:extend()
|
||||
|
@ -8,7 +8,6 @@ local Fighter = require "scenes.menus.debugmenus.choregraphy.mocks.fighter"
|
|||
|
||||
function ChoregraphyViewer:new()
|
||||
ChoregraphyViewer.super.new(self)
|
||||
self.assets:batchImport("assets.commons")
|
||||
self.assets:batchImport("assets.battle")
|
||||
self.world = World(self)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
local Scene = require "birb.modules.scenes"
|
||||
local Scene = require "game.scenes"
|
||||
local menu = require "scenes.menus.mainmenu.menu"
|
||||
|
||||
local DebugMenu = Scene:extend()
|
||||
|
@ -11,7 +11,6 @@ local TweenManager = require "birb.classes.time"
|
|||
|
||||
function DebugMenu:new()
|
||||
DebugMenu.super.new(self)
|
||||
self.assets:batchImport("assets.commons")
|
||||
menu.commons.MainMenu(self, "BaseMenu")
|
||||
menu.StartGameWidget(self, "BaseMenu")
|
||||
menu.commons.SceneWidget(self, "BaseMenu", scenes.menus.options, "Options")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
local Scene = require "birb.modules.scenes"
|
||||
local Scene = require "game.scenes"
|
||||
local OptionsMenu = Scene:extend()
|
||||
|
||||
local OptionMenu = require "scenes.menus.options.menu"
|
||||
|
@ -10,7 +10,6 @@ local MenuBack = require "game.modules.gui.menuback"
|
|||
function OptionsMenu:new()
|
||||
OptionsMenu.super.new(self)
|
||||
|
||||
self.assets:batchImport("assets.commons")
|
||||
self:addMenu("main", true)
|
||||
self:addSubMenu("video", "Video")
|
||||
self:addSubMenu("audio", "Audio")
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
]]
|
||||
|
||||
local Scene = require "birb.modules.scenes"
|
||||
local Scene = require "game.scenes"
|
||||
local TitleScreen = Scene:extend()
|
||||
local gui = require "game.modules.gui"
|
||||
|
||||
|
@ -34,11 +34,8 @@ function TitleScreen:new(fromMenu)
|
|||
local fromMenu = (fromMenu == true)
|
||||
|
||||
self.borders = gui.newBorder(424, 30, 8)
|
||||
self.assets:batchImport("assets.commons")
|
||||
self.assets:addImage("logo", "assets/artworks/logo.png")
|
||||
self.assets:addTileset("charicons", "assets/sprites/characters/charicons")
|
||||
self.assets.fonts["small"]:setLineHeight(16/18)
|
||||
self.assets.fonts["small"]:setFilter("shadow")
|
||||
|
||||
self.tweens = TweenManager(self)
|
||||
self:initBackground()
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
]]
|
||||
|
||||
local Scene = require "birb.modules.scenes"
|
||||
local Scene = require "game.scenes"
|
||||
local OverWorld = Scene:extend()
|
||||
|
||||
local World = require "scenes.overworld.world"
|
||||
|
@ -38,10 +38,7 @@ local MessageQueue = require "game.modules.messagequeue"
|
|||
function OverWorld:new(area, playerx, playery)
|
||||
OverWorld.super.new(self)
|
||||
self.charsetManager = CharsetManager(self)
|
||||
self.assets:batchImport("assets.commons")
|
||||
self.assets:batchImport("assets.overworld")
|
||||
self.assets.fonts["small"]:setLineHeight(16/18)
|
||||
self.assets.fonts["small"]:setFilter("shadow")
|
||||
|
||||
self.tweens = TweenManager(self)
|
||||
self.screens = screens
|
||||
|
|
|
@ -72,7 +72,6 @@ function CharacterScreen:setMenu()
|
|||
end
|
||||
|
||||
function CharacterScreen:draw()
|
||||
self.scene.assets.fonts["small"]:setLineHeight(16/18)
|
||||
if (self.page ~= nil) then
|
||||
self.page:draw()
|
||||
end
|
||||
|
|
|
@ -90,7 +90,6 @@ function ItemsScreen:removeUseMenu()
|
|||
end
|
||||
|
||||
function ItemsScreen:draw()
|
||||
self.scene.assets.fonts["small"]:setLineHeight(16/18)
|
||||
self:drawPocket()
|
||||
self:drawDescription(const.X, const.Y2 - (88+16))
|
||||
self:drawEffects(const.X, const.Y2 - 40)
|
||||
|
|
Loading…
Reference in a new issue