marklovers / kaplay

🦖 A JavaScript game library
https://kaplayjs.com
MIT License
230 stars 14 forks source link

feat: obj.cancelAllTweens() #172

Open amyspark-ng opened 1 week ago

amyspark-ng commented 1 week ago

Is your feature request related to a problem? Please describe.

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Pretty descriptive, would come from the timer object and would cancel all tweens that are attached to it

mflerackers commented 1 week ago

Does timer even keep track of the tweens? I don't think so. Since they are ephemeral.

amyspark-ng commented 1 week ago

could push them to a tweens property?

mflerackers commented 1 week ago

But you'd have to add a tween.onEnd(()=>tweens.splice(tweens.indexOf(tween), 1)) to clean them up etc.

amyspark-ng commented 1 week ago

would this be unperformant? what'd be the issue with it