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

58 lines
1.3 KiB
Lua
Raw Normal View History

local Scene = require "core.modules.scenes"
local BattleSystem = Scene:extend()
local BattleArena = require "scenes.battlesystem.controller.battlearena"
local ActorManager = require "scenes.battlesystem.controller.actors"
local HUD = require "scenes.battlesystem.controller.hud"
local Cursor = require "scenes.battlesystem.controller.cursor"
local MenuSystem = require "scenes.battlesystem.controller.menu"
2019-08-14 13:56:25 +02:00
local gui = require "game.modules.gui"
function BattleSystem:new()
BattleSystem.super.new(self)
2019-08-14 13:56:25 +02:00
self.assets:batchImport("scenes.battlesystem.assets")
2019-08-14 13:56:25 +02:00
self.frame = gui.newBorder(424, 30, 8)
self:initManagers()
self:register()
end
function BattleSystem:initManagers()
self.datas = {}
self.battlearena = BattleArena(self)
self.actormanager = ActorManager(self)
self.cursor = Cursor(self)
self.menu = MenuSystem(self)
end
function BattleSystem:update(dt)
self.battlearena:update(dt)
self.cursor:update(dt)
self.actormanager:update(dt)
end
function BattleSystem:draw()
self.battlearena:draw()
self.cursor:drawBottom()
self.battlearena:drawEntities()
self.cursor:drawTop()
2019-08-14 13:56:25 +02:00
love.graphics.draw(self.frame, 424, 20, 0, -1, -1)
self.actormanager:draw()
end
function BattleSystem:exit()
self.world:destroy()
self.battlearena = nil
collectgarbage()
end
return BattleSystem