Sign in to follow this  
Zaku

Winterbells-like object movement

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this