Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to make my first Tile-game using XNA. I have no problem drawing the map layers using TiledLib from codeplex, but, now I want to give sprite an (order) to move to a specific position on map, by selecting the sprite (left mouse click) and then right mouse click somewhere on the map to specify the target position. I don’t know what is the best practice to move sprite this way, considering that there may be collision objects in the direct path.

What is the best practice to do this? Is there any demo covering this issue?

BTW: I couldn’t upload snapshot because of my low score :(

share|improve this question
If you put a link to the image somewhere, one of us higher-rep'd users will edit it in :) – The Communist Duck Mar 6 '11 at 11:31
up vote 2 down vote accepted

You may want to look up the A* pathfinding algorithm and some material explaining it.

share|improve this answer
I'd like to add this link: It may be complex to understand sometimes but it really helped me to understand A*. Good luck! – Jesse Emond Mar 6 '11 at 19:39
+1 for amit's page. It is honestly an amazing page. – The Communist Duck Mar 6 '11 at 21:55
Thanks, this is new subject for me, I’ll study it…Answer accepted. – Robin-Hood Mar 7 '11 at 8:23
@Jesse +1 thanks, very good link... – Robin-Hood Mar 7 '11 at 8:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.