Skip to main content

Posts

Showing posts from July, 2015

Pathfinding

I tried to implement path-finding using a star for the first time. If you are not familiar with a star it is an algorithm that is used to quickly find the shortest path from one point to another. You can read more about it here .  You can see in this first gif that after the two objects are done moving they stack on top of each other. That can be fixed by giving them separate positions to end up at. Right now I click somewhere and it moves both of them to that same exact spot.     In this gif the problem is fixed. The objects are stored in a 2d array and their end position is offset by their index in the array. This way they will always end their movement in formation.