Skip to content

lsq51201314/go-astar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-astar

A*寻路算法

引入包:

"github.com/lsq51201314/go-astar"

新建寻路

a := astar.NewAstar(1002, 802)

设置数据

data, err := ioutil.ReadFile("./test.map")
if err != nil {
	panic(err)
}
a.SetData(data)

获取路径

a.Find(110, 100, 846, 674)
fmt.Println(len(a.GetPath()))

验证点

fmt.Println(a.CheckPoint(0, 0))
fmt.Println(a.CheckPoint(110, 100))

测试结果 image

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages