noble engine migration

This commit is contained in:
2024-06-01 16:52:11 +03:00
parent ea0681b60d
commit 29a5ed2f62
140 changed files with 17016 additions and 1653 deletions

View File

@@ -0,0 +1,32 @@
local pd <const> = playdate
local gfx <const> = Graphics
BaseScene = {}
class("BaseScene").extends(NobleScene)
function BaseScene:init()
BaseScene.super.init(self)
pd.resetElapsedTime() -- Reset time so each scene starts at 0
self.optionsMenu = pd.getSystemMenu() -- Store this so we have access to it in all scenes
end
function BaseScene:update()
BaseScene.super.update(self)
Particles:update() -- Update our particle library
end
function BaseScene:exit()
BaseScene.super.exit(self)
self.optionsMenu:removeAllMenuItems() -- Remove all custom menu items and reset menu image
pd.setMenuImage(nil)
end
function BaseScene:drawBackground()
BaseScene.super.drawBackground(self)
if self.background ~= nil then -- Helper so you can set a scene's background to an image
self.background:draw(0, 0)
end
end