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

60 lines
1.4 KiB
Lua
Raw Permalink 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"
function BattleSystem:new()
BattleSystem.super.new(self)
self:initManagers()
self:register()
end
function BattleSystem:initManagers()
--self.loader = Loader()
self.datas = {}
self.battlearena = BattleArena(self)
self.actormanager = ActorManager(self)
self.hud = HUD(self)
self.cursor = Cursor(self)
self.menu = MenuSystem(self)
end
function BattleSystem:update(dt)
self.hud:update(dt)
self.battlearena:update(dt)
self.cursor:update(dt)
self.actormanager:update(dt)
end
function BattleSystem:draw()
--CScreen:apply()
love.graphics.setColor(1, 1, 1, 1)
love.graphics.rectangle("fill", 0, 0, 424, 240)
--love.graphics.draw(self.background, 0, 0)
self.battlearena:draw()
self.cursor:drawBottom()
self.battlearena:drawEntities()
self.cursor:drawTop()
self.hud:draw()
self.actormanager:draw()
--CScreen:cease()
end
function BattleSystem:exit()
self.world:destroy()
self.battlearena = nil
collectgarbage()
end
return BattleSystem