40 lines
1.1 KiB
Lua
40 lines
1.1 KiB
Lua
local Scene = require "game.scenes"
|
|
local menu = require "scenes.menus.debugmenus.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("assets.debug")
|
|
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.menus.main, "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
|