Advertisement

2D Tilemap pathfinding

Started by May 14, 2011 04:20 PM
1 comment, last by Tomolia 13 years, 6 months ago
Hey everyone!

May not be the right subforum so sorry if its not.

Anyways Im working on a little game of mine with a 2D tilemap.

I've implemented "click to move" and A* for pathfinding on my map.

Problem is that I dont want movement to be from tile to tile.

I would like to be able to click a few pixels from my character and move him there without him always going to the center of the tile I clicked on.

I guess one solution would be dividing my tiles into several smaller nodes for the pathfinding and thus making it less notisable but this would slow down the pathfinding I guess.

Anyone have any theory on how I could acomplish this or perhaps any links to share?

Thanks for any help!

/TL
You could define offsets that they should move to within the tile. When you determine your path, just set the last way point to use the offset of where the mouse clicked within the tile. This could also be helpful, especially if you have objects that overlap portions of a tile, but not enough to make it impassible. That way they will move around the objects.
[ dev journal ]
[ current projects' videos ]
[ Zolo Project ]
I'm not mean, I just like to get to the point.
Advertisement
Thanks for the help :)

This topic is closed to new replies.

Advertisement