Last active
November 30, 2023 15:32
-
-
Save luizbills/7c20ee99c5411d35764496cc685c7a51 to your computer and use it in GitHub Desktop.
Kaboom.js - Tween Yoyo (go and back)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function tweenYoyo (from, to, dur, setValue, easeFunc = null, repeat = Infinity) { | |
while(repeat > 0) { | |
await tween( | |
from, | |
to, | |
dur, | |
setValue, | |
easeFunc | |
); | |
await tween( | |
to, | |
from, | |
dur, | |
setValue, | |
easeFunc | |
); | |
repeat--; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment