soft - don't set variables, lerp them

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
Ulydev
Party member
Posts: 445
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

soft - don't set variables, lerp them

Post by Ulydev »

Hey there, lövers!

Here's another minimalist library, soft.

By replacing

Code: Select all

variable = value
to

Code: Select all

variable:to(value)
it takes care of lerping the values, giving a smoother look to your games.

https://github.com/Ulydev/soft
User avatar
Kingdaro
Party member
Posts: 395
Joined: Sun Jul 18, 2010 3:08 am

Re: soft - don't set variables, lerp them

Post by Kingdaro »

Nice, beat me to it :P

Personally, I'd change the soft:set boolean param to the string 'reset'. This makes it a lot clearer what the function's doing with the second parameter from the outset, and allows the addition of other parameters if you like.
User avatar
Ulydev
Party member
Posts: 445
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

Re: soft - don't set variables, lerp them

Post by Ulydev »

Kingdaro wrote:Personally, I'd change the soft:set boolean param
Done, thanks for the suggestion! :nyu:
ObeyJay
Prole
Posts: 4
Joined: Thu Apr 23, 2015 6:22 pm

Re: soft - don't set variables, lerp them

Post by ObeyJay »

This looks great.
But what if I need to change the value :by() a given amount? (ie, relative to the current value instead of absolute)
Do you think it's worth implementing it?
User avatar
Ulydev
Party member
Posts: 445
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

Re: soft - don't set variables, lerp them

Post by Ulydev »

ObeyJay wrote:This looks great.
But what if I need to change the value :by() a given amount? (ie, relative to the current value instead of absolute)
Do you think it's worth implementing it?

Code: Select all

var:to( var:get(true) + x) 
Sure, I'll consider adding a shortcut.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 4 guests