This is not cocos2D-x specific. Its just general coding problem
An object has a position and target
I want its speed to reduce like exponentially as it gets closer to target. I want to use the distance between them to make my sped value
One example that works
float speed = distance / 10;
if(speed > maxSpeed){speed = maxSpeed;}
As distance gets towards zero, speed reduces to zero…
I’m just trying see if there is a more awesome way, I imagine its a cool little wee bit of logic.
Any takers
The idea is that the speed slows down smooth as ice