r/programming • • Apr 23 '13

PathFinding algorithm, visually explained

http://qiao.github.io/PathFinding.js/visual/
2.2k Upvotes

230 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Apr 24 '13

Diagonal would still be fixed value.

What I meant was that the coordinates of your character are likely stored as x and y values and to update these you need to calculate newx= x+speed*sin(direction) as opposed to newx= x+speed

No one in their right mind would suggest this to be a bottleneck.

I agree, but this is the only reason I could think of why someone would use the "wrong" system. Anyone who has a job in the industry will know how to do this properly.

If you google for it you will find that apparently a lot of games have this issue, so maybe updating coordinates is a lot more time consuming than it seems.