公告
财富商城
积分规则
提问
发文
2019-08-29 01:50发布
Bombasti
there is my astar algorithm, But I don't know how to get parent and get a quick route from the Destination.
Node script methods getPos() (Vector2) Parent (Node) Node n = ?.Parent; while(n != null) { path.add(n.getPos()); n = n.Parent; }
You have to set "current" as parent to the adjacent nodes. Then if the destination is found, you follow the path of the parent entries, this is the path
EDIT: Also i can´t see a "cost" implementation ...
最多设置5个标签!
You have to set "current" as parent to the adjacent nodes. Then if the destination is found, you follow the path of the parent entries, this is the path
EDIT: Also i can´t see a "cost" implementation ...