I'd like to tune the behavior of an easing function, but the 'amplitude' tunable parameter doesn't seem to do anything.
I'm using outElastic
, which according to the documentation has optional arguments a
(amplitude), and p
(period). The default bounce is too bouncy, so wanted to try adjusting a
to tone the bounce down.
The documentation wasn't super clear for how to set a
, but I found examples in /PlaydateSDK/Examples/Single File Examples/animator.lua
where similar tunable parameters were set for easing functions. In those examples the optional arguments are set after declaring the animator (see example below for repeatCount
):
local parts = {topArc3, rightLine3, bottomArc3, leftLine3}
local spriteAnimation = Animator.new(5000, parts, playdate.easingFunctions.linear)
spriteAnimation.repeatCount = -1
I tried to copy that approach like this:
local _easing = pd.easingFunctions.outElastic
self.animator = gfx.animator.new(750, self.x, self.target_x, _easing)
self.animator.easingAmplitude = 1000
But no matter what extreme values I try for the amplitude the in-game behavior seems the same. Am I doing this right?
Running Linux (Ubuntu 22.04)