• Advertisement
Sign in to follow this  

Winterbells-like object movement

This topic is 3392 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm making a game, and it has a character, and I want him to be able to follow the mouse the exact same way that the little bunny follows the mouse in winterbells(when he's airborne). http://www.ferryhalim.com/orisinal/g3/bells.htm What's the simplest way to go about doing this?

Share this post


Link to post
Share on other sites
Advertisement
Well the Further away the mouse is the faster the rabit moves. But at the same time there's also a max speed.

I'd look at a log graph for the answer.

Log ((DistanceBetweenMouseAndChar) / STRETCH_FACTOR ) * MAX_SPEED


You're going to have to compute the distance between the character and the mouse. make it positive.

the stretch factor is used to make the graph longer. max speed to make it so the rabbit moves faster.

If you use a logarithm function you're also going to have to add logic for going in both directions.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement