This commit is contained in:
2026-02-23 20:52:54 +01:00
parent fae2abf94e
commit 9eb426021e
32 changed files with 268 additions and 78 deletions

View File

@@ -4,19 +4,6 @@ local scene = Game
local font = Graphics.font.new('assets/fonts/Mini Sans 2X')
local function screenShake(shakeTime, shakeMagnitude)
local shakeTimer = playdate.timer.new(shakeTime, shakeMagnitude, 0)
shakeTimer.updateCallback = function(timer)
local magnitude = math.floor(timer.value)
local shakeX = math.random(-magnitude, magnitude)
local shakeY = math.random(-magnitude, magnitude)
playdate.display.setOffset(shakeX, shakeY)
end
shakeTimer.timerEndedCallback = function()
playdate.display.setOffset(0, 0)
end
end
function scene:drawBackground()
local speed = 0.1
if scene.ground ~= nil then
@@ -66,8 +53,6 @@ end
function scene:start()
scene.super.start(self)
playdate.ui.crankIndicator:draw() -- not sure why this is not working
self.optionsMenu:addMenuItem("Main Menu", function() Noble.transition(Menu) end)
Noble.showFPS = false
end
@@ -103,14 +88,13 @@ function scene:enter()
end
end
function round(number)
local formatted = string.format("%.2f", number)
return formatted
end
function scene:update()
scene.super.update(self)
if playdate.isCrankDocked() then
playdate.ui.crankIndicator:draw()
end
if scene.player == nil then
return
end
@@ -169,6 +153,7 @@ function scene:exit()
if scene.tank ~= nil then
scene.tank:remove()
end
scene.helloAudio:stop()
scene.telemLostSound:stop()
scene.levelAudio:stop()
scene.balebaSpawner:remove()