Page 1 of 1

move to clicked position

PostPosted: Tue May 16, 2006 9:29 pm
by frodo
I have a man, different platforms of ground, and latters that he can climb.
I want to click a place on the screen, and the man walks to as close as he can to the place where I clicked without him flying.
If you answer me something that works than your my best friend!!!!!!!!!!!!!
Thanks

PostPosted: Tue May 16, 2006 11:14 pm
by DilloDude
Well, you could keep him on the ground with gravity: yvelocity += .5, and physical response. You could have a large filled region to catch mouse clicks, and find if xmouse is greater than or less than player.xscreen, and adjust player's x acco5rdingly. Or make an actor that moves to the mouse when you click, and on player->draw actor, find if x > destination.x + 5, and if so, x += 5. Then if x < destination.x < x - 5, x -= 5. Then adjust animations accordingly. That would make him walk left and right. To make him decide when to climb ladders would be harder.