alpha 0.1

This commit is contained in:
2024-06-10 01:50:27 +03:00
parent 4d7f25c027
commit 43512c90c7
26 changed files with 2113 additions and 63 deletions

View File

@@ -0,0 +1,17 @@
function round(number)
local formatted = string.format("%.2f", number)
return formatted
end
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