Before I keep cracking on... is this an ok approach to create a decelerate function and/ or a cool down
function playdate.update()
playdate.timer.updateTimers()
gfx.sprite.update()
if playdate.buttonIsPressed( playdate.kButtonUp ) then
if (thrustSpeed < maxSpeed)
then
thrustSpeed += 1
end
print (thrustSpeed)
end
if playdate.buttonJustReleased( playdate.kButtonUp ) then
local function timerCallback()
if (thrustSpeed > 0)
then
thrustSpeed -= 1
print (thrustSpeed)
end
if (thrustSpeed == 0)
then
keyTimer:remove()
end
end
keyTimer = playdate.timer.keyRepeatTimer(timerCallback)
end
end