2019-03-10 13:26:20 +01:00
|
|
|
local Scene = require "core.modules.scenes"
|
2019-03-10 13:11:26 +01:00
|
|
|
|
2019-03-10 13:26:20 +01:00
|
|
|
local BattleSystem = Scene:extend()
|
|
|
|
|
2019-08-14 16:26:23 +02:00
|
|
|
local World = require "scenes.battlesystem.world"
|
|
|
|
local MenuSystem = require "scenes.battlesystem.menu"
|
2019-03-10 13:26:20 +01:00
|
|
|
|
|
|
|
function BattleSystem:new()
|
2019-03-10 13:33:38 +01:00
|
|
|
BattleSystem.super.new(self)
|
2019-08-14 13:56:25 +02:00
|
|
|
|
2019-08-13 21:08:37 +02:00
|
|
|
self.assets:batchImport("scenes.battlesystem.assets")
|
|
|
|
|
2019-03-10 13:26:20 +01:00
|
|
|
self:initManagers()
|
2019-03-10 13:33:38 +01:00
|
|
|
|
|
|
|
self:register()
|
2019-03-10 13:26:20 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
function BattleSystem:initManagers()
|
|
|
|
self.datas = {}
|
2019-08-14 16:26:23 +02:00
|
|
|
self.world = World(self)
|
2019-03-23 11:51:47 +01:00
|
|
|
self.menu = MenuSystem(self)
|
2019-03-10 13:11:26 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
function BattleSystem:update(dt)
|
2019-08-14 16:26:23 +02:00
|
|
|
self.world:update(dt)
|
2019-03-10 13:11:26 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
function BattleSystem:draw()
|
2019-08-14 16:26:23 +02:00
|
|
|
self.world:draw()
|
2019-03-10 13:11:26 +01:00
|
|
|
end
|
|
|
|
|
2019-03-10 13:26:20 +01:00
|
|
|
function BattleSystem:exit()
|
|
|
|
self.world:destroy()
|
|
|
|
self.battlearena = nil
|
2019-03-10 13:11:26 +01:00
|
|
|
|
|
|
|
collectgarbage()
|
|
|
|
end
|
|
|
|
|
|
|
|
return BattleSystem
|