@Socks -- You are describing elastic easing -- rather than bounce-back easing. I haven't got elastic easing working very well yet. (Its got some fun math.) However, I did put together an elastic function that might work for you. It goes instantly to the target value and then overshoots and corrects in a decaying fashion. It might work for you.
I put it into the format you are familiar with. It is a version of AAA*sin(self.Time*BBB)+CCC
In regards to easing this is pretty cool work in CSS - this might help - it's like a curves bar to control your eases - maybe you smart guys can do something with this?
Hello! Apologies to revive such an old thread, but I have been trying this method of creating my own interpolations so movement looks smooth and collisions still work.
In my project, I'm trying to make an actor move in a V pattern using the following code:
When self.positionX = 384
After 3 seconds (I want the actor to hover in the middle of the screen for a bit)
-change attribute: self.beginTime to self.Time
-for self.duration seconds
--constrain attribute: self.positionX to ( self.X420 - self.X384 )(( self.Time - self.beginTime )/ self.duration )+ self.X384
--constrain attribute: self.positionY to ( self.Y900 - self.Y700 )(( self.Time - self.beginTime )/ self.duration1 )+ self.Y700
Left to right, moving down and and back up seems to work perfectly. On the last rule, the actor only goes to X: 384.3 and Y:677.8. I have further rules that fire when X is 384 and Y is 700.
I'm thinking this has something to do with self.beginTime? I've tried using timers and that doesn't seem to work either. Can someone help me find what I'm missing?
By the way, have you considered using the MoveTo behavior? It will give you the same functionality as your current setup, and you won't have the overhead of all those constrain behaviors.
I did try MoveTo before and had a problem, so I tried interpolate and came across the collision issue.
I'll give it another go. I was probably doing something else stupid.
Thanks again!
uptimistikKey Master, Member, Sous Chef, PROPosts: 297
Reviving this for any newcomers...wealth of information in here :)
GameSalad Templates and Custom Development at the Official Marketplace: http://gshelper.com
Comments
I guess I was too lazy to round correctly. I'd be curious to see if it does affect accuracy in a noticeable way.
http://matthewlein.com/ceaser/?utm_source=unmatchedstyle+live+list&utm_campaign=ed5ea9e159-UMS_Newsletter_July6_28_2013&utm_medium=email&utm_term=0_cc5d964e0c-ed5ea9e159-335334033
Cheers, M@
Hello! Apologies to revive such an old thread, but I have been trying this method of creating my own interpolations so movement looks smooth and collisions still work.
In my project, I'm trying to make an actor move in a V pattern using the following code:
When self.positionX = 350
-change attribute: self.beginTime to self.Time
-for self.duration seconds
--constrain attribute: self.positionX to ( self.X384 - self.X350 )(( self.Time - self.beginTime )/ self.duration)+ self.X350
--constrain attribute: self.positionY to ( self.Y700 - self.Y900 )(( self.Time - self.beginTime )/ self.duration )+ self.Y900
When self.positionX = 384
After 3 seconds (I want the actor to hover in the middle of the screen for a bit)
-change attribute: self.beginTime to self.Time
-for self.duration seconds
--constrain attribute: self.positionX to ( self.X420 - self.X384 )(( self.Time - self.beginTime )/ self.duration )+ self.X384
--constrain attribute: self.positionY to ( self.Y900 - self.Y700 )(( self.Time - self.beginTime )/ self.duration1 )+ self.Y700
When self.positionX = 420
-change attribute: self.beginTime to self.Time
-for self.duration seconds
--constrain attribute: self.positionX to ( self.X384 - self.X420 )(( self.Time - self.beginTime )/ self.duration )+ self.X420
--constrain attribute: self.positionY to ( self.Y700 - self.Y900 )(( game.Time - self.beginTime )/ self.duration )+ self.Y900
Left to right, moving down and and back up seems to work perfectly. On the last rule, the actor only goes to X: 384.3 and Y:677.8. I have further rules that fire when X is 384 and Y is 700.
I'm thinking this has something to do with self.beginTime? I've tried using timers and that doesn't seem to work either. Can someone help me find what I'm missing?
Thanks heaps!
Is it because you have a typo (self.duration1) in the second interpolation?
@RThurman
Thanks so much for the reply. That was just a typo in my post. They all say self.duration.
I have isolated this actor in separate project and getting the same issues. If it helps to see it all in action:
https://www.dropbox.com/s/s2vmzvj5y22x3h0/Interpolation Issue.gameproj.zip?dl=0
Thanks
Could it be that you use game.Time in some of the constrain behaviors (instead of self.Time)?
D'oh! Definitely have been looking at this way too long.
Going back up and to the left is still funny, but I certainly work with that.
Thank you so much, @RThurman !
You are welcome.
By the way, have you considered using the MoveTo behavior? It will give you the same functionality as your current setup, and you won't have the overhead of all those constrain behaviors.
I did try MoveTo before and had a problem, so I tried interpolate and came across the collision issue.
I'll give it another go. I was probably doing something else stupid.
Thanks again!
Reviving this for any newcomers...wealth of information in here :)
GameSalad Templates and Custom Development at the Official Marketplace: http://gshelper.com
Thanks for reviving this @uptimistik !
GameSalad is great for exploring different concepts like this.