sonic-radiance/sonic-radiance.love/scenes/debug/viewers/battleBack/init.lua

41 lines
1.1 KiB
Lua
Raw Normal View History

2021-05-05 08:30:32 +02:00
local Scene = require "birb.modules.scenes"
2020-08-01 14:01:08 +02:00
local menu = require "scenes.debug.viewers.battleBack.menu"
local BackgroundViewer = Scene:extend()
local Background = require "game.modules.drawing.parallaxBackground"
local backgroundList = require "datas.gamedata.maps.shoot.zones"
function BackgroundViewer:new()
BackgroundViewer.super.new(self)
self.assets:batchImport("scenes.debug.commons.assets")
menu.commons.DebugMenu(self, "MainMenu")
self:setBackground("city")
for backId, backgroundData in pairs(backgroundList) do
menu.ShowBackgroundWidget(self, "MainMenu", backgroundData.name, backId)
end
menu.commons.SceneWidget(self, "MainMenu", scenes.debug.menu, "Back")
self.menusystem:activate()
self.menusystem:switchMenu("MainMenu")
end
function BackgroundViewer:update(dt)
if (love.keyboard.isDown("z") and (not self.menusystem.isActive)) then
self.menusystem:activate()
end
end
function BackgroundViewer:setBackground(newBackground)
self.background = Background(self, 5, 1, newBackground)
end
function BackgroundViewer:draw()
self.background:draw()
end
return BackgroundViewer