sonic-bluestreak/sonic-bluestreak.love/scenes/menus/debugmenus/battleBack/init.lua

41 lines
1.1 KiB
Lua
Raw Permalink Normal View History

2021-11-25 10:57:13 +01:00
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