move to clicked position

Non-platform specific questions.

move to clicked position

Postby frodo » Tue May 16, 2006 9:29 pm

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
User avatar
frodo
 
Posts: 127
Joined: Tue Mar 21, 2006 6:53 pm
Location: universe
Score: 2 Give a positive score

Postby DilloDude » Tue May 16, 2006 11:14 pm

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.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest