HTML5 Canvas A* Star Path finding
Posted
by
Veyha
on Game Development
See other posts from Game Development
or by Veyha
Published on 2012-06-16T08:42:52Z
Indexed on
2012/06/16
9:23 UTC
Read the original article
Hit count: 248
I am trying to learn A* Star Path finding. Library I am using this - https://github.com/qiao/PathFinding.js
But I am don't understand one thing how to do.
I am need find path from player.x/player.y (player.x and player.y is both 0) to 10/10
This code return array of where I am need to move - var path = finder.findPath(player.x, player.y, 10, 10, grid);
I am get array where I am need to move, but how to apply this array to my player.x and player.y?
Array structure like - 0: 0 1: 0 length: 2
, 0: 1 1: 0 length: 2
, ...
I am very sorry for my bad English language. Thanks.
© Game Development or respective owner