2021-05-05 08:30:32 +02:00
|
|
|
local Scene = require "birb.modules.scenes"
|
2021-08-15 16:26:05 +02:00
|
|
|
local menu = require "scenes.menus.debugmenus.battleBack.menu"
|
2020-08-01 14:01:08 +02:00
|
|
|
|
|
|
|
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)
|
2021-08-15 16:13:20 +02:00
|
|
|
self.assets:batchImport("assets.commons")
|
2021-08-15 16:01:25 +02:00
|
|
|
self.assets:batchImport("assets.debug")
|
2020-08-01 14:01:08 +02:00
|
|
|
menu.commons.DebugMenu(self, "MainMenu")
|
|
|
|
|
|
|
|
self:setBackground("city")
|
|
|
|
|
|
|
|
for backId, backgroundData in pairs(backgroundList) do
|
|
|
|
menu.ShowBackgroundWidget(self, "MainMenu", backgroundData.name, backId)
|
|
|
|
end
|
2021-08-15 16:26:05 +02:00
|
|
|
menu.commons.SceneWidget(self, "MainMenu", scenes.menus.main, "Back")
|
2020-08-01 14:01:08 +02:00
|
|
|
|
|
|
|
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
|