Smoof.lua is this lovely function wrapped up in a library:
Code: Select all
value = value + (target - value) * smoothing
Load it
Code: Select all
smoof = require("smoof.lua")
Code: Select all
smoof:update(dt)
Code: Select all
object = {x = 0, y = 0}
Code: Select all
smoof:new(object, {x = 32})
You can download this demo below if you want to mess around with it.