sonic-radiance/sonic-radiance.love/scenes/battlesystem/init.lua

60 lines
1.1 KiB
Lua
Raw Normal View History

local Scene = require "core.modules.scenes"
local BattleSystem = Scene:extend()
local World = require "scenes.battlesystem.world"
local MenuSystem = require "scenes.battlesystem.menu"
local VictoryScreen = require "scenes.battlesystem.screens.victory"
function BattleSystem:new()
BattleSystem.super.new(self)
2019-08-14 13:56:25 +02:00
self.assets:batchImport("scenes.battlesystem.assets")
self:initManagers()
self:register()
self:startBattle()
self.screen = nil
end
function BattleSystem:initManagers()
self.datas = {}
self.world = World(self)
self.menu = MenuSystem(self)
end
function BattleSystem:startBattle()
self.world:startBattle()
end
function BattleSystem:finishBattle()
self.screen = VictoryScreen(self)
end
function BattleSystem:update(dt)
self.world:update(dt)
if (self.screen ~= nil) then
self.screen:update(dt)
end
end
function BattleSystem:draw()
self.world:draw()
if (self.screen ~= nil) then
self.screen:draw()
end
end
function BattleSystem:exit()
self.world:destroy()
self.battlearena = nil
collectgarbage()
end
return BattleSystem