js版本A*寻路算法_javascript技巧

WBOY
Release: 2016-05-16 19:23:05
Original
1187 people have browsed it

说到做游戏,必不可少的需要用到寻路算法,一般游戏里的寻路算法大多数都以A*算法为主,这里也就实现了js里采用a*寻路的程序,在51js和蓝色都开了帖。

程序是以前写的,后来也没有修正或者精简,有冗余之处大家还见谅一下。

当然,这个寻路算法也不是最优化的,像幻宇开发的“交点寻径法”也是个中精品,两者可谓各有千秋,只是如果地图很大的情况下,我们会惊讶于“交点寻径法”的迅速。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!