TodePond / Habitat

my javascript helpers
MIT License
45 stars 5 forks source link

Update Tween to include more parameters #18

Closed Magnogen closed 2 years ago

Magnogen commented 2 years ago

ease (expects a fuction that returns a value, or a fuction that returns a function that returns a value)

I plan on adding support for number of bounces in Tween.EASE_..._BOUNCE, as well as dampening for Tween.EASE_..._ELASTIC, but idk how to do that yet lol

Magnogen commented 2 years ago

Aight now the EASE_..._EXPONENTIAL(strength) works a lot nicer, here's a comparison:

ezgif-3-1ff566c6f5

It's very similar to EASE_..._POWER(strength), just slightly different

Comparison: ezgif-3-a7859f4788

TodePond commented 2 years ago

This is looking really cool!

I'll have a closer look at it when I'm at my computer!

Magnogen commented 2 years ago

The main difference between EXP(strength) and POWER(strength) is that EXP forms a straight line when the strength is 0, whereas POWER forms a straight line at 1 - as shown (green is EXPONENTIAL, blue is POWER)

ezgif-3-256dea3e11

TodePond commented 2 years ago

Still haven't forgotten about this! Hopefully I can merge today or tomorrow!