代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
ActionScript
】
AS2寻路算法
作者:
/ 发布于
2011/1/3
/
2405
<div> <table style="font-family: monospace" class="actionscript codes"> <tbody> <tr class="li1"> <td style="line-height: 150%; font-family: Verdana, Monospace; font-size: 12px; font-weight: bold; margin-right: 10px"> <pre style="line-height: 150%; font-family: Verdana, Monospace; font-size: 12px; font-weight: bold; margin-right: 10px"><span style="color: blue">Stage</span>.<span style="color: blue">scaleMode</span> = <span style="color: #ff0000">"noScale"</span>; <span style="color: #0000ff">var</span> nx = <span style="color: #cc66cc">25</span>;<span style="font-style: italic; color: #808080">//地图横向格数</span> <span style="color: #0000ff">var</span> ny = <span style="color: #cc66cc">15</span>;<span style="font-style: italic; color: #808080">//地图纵向格数</span> <span style="color: #0000ff">var</span> mmap = <span style="color: #0000ff">new</span> <span style="color: blue">Array</span><span style="color: #66cc66">(</span>ny<span style="color: #66cc66">)</span>;<span style="font-style: italic; color: #808080">//地图的数组</span> <span style="color: #0000ff">var</span> vmap = <span style="color: #0000ff">new</span> <span style="color: blue">Array</span><span style="color: #66cc66">(</span><span style="color: #cc66cc">4</span><span style="color: #66cc66">*</span>ny<span style="color: #66cc66">*</span>nx<span style="color: #66cc66">)</span>;<span style="font-style: italic; color: #808080">//广度搜索的结点存储数组</span> <span style="color: #0000ff">var</span> fmap = <span style="color: #0000ff">new</span> <span style="color: blue">Array</span><span style="color: #66cc66">(</span>ny<span style="color: #66cc66">)</span>;<span style="font-style: italic; color: #808080">//搜索过的结点及障碍标志</span> <span style="color: #0000ff">var</span> parrow = <span style="color: #0000ff">new</span> <span style="color: blue">Array</span><span style="color: #66cc66">(</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">1</span>, <span style="color: #cc66cc">0</span><span style="color: #66cc66">]</span>, <span style="color: #66cc66">[</span><span style="color: #cc66cc">0</span>, <span style="color: #cc66cc">1</span><span style="color: #66cc66">]</span>, <span style="color: #66cc66">[</span>-<span style="color: #cc66cc">1</span>, <span style="color: #cc66cc">0</span><span style="color: #66cc66">]</span>, <span style="color: #66cc66">[</span><span style="color: #cc66cc">0</span>, -<span style="color: #cc66cc">1</span><span style="color: #66cc66">]</span><span style="color: #66cc66">)</span>;<span style="font-style: italic; color: #808080">//四个方向的行动参数</span> <span style="color: #0000ff">var</span> cp = <span style="color: #cc66cc">0</span>;<span style="font-style: italic; color: #808080">//当前到达的路径结点的指针</span> <span style="color: #0000ff">var</span> finded = <span style="color: #0000ff">false</span>;<span style="font-style: italic; color: #808080">//搜索成功标志</span> <span style="color: blue">_root</span>.<span style="color: blue">createEmptyMovieClip</span><span style="color: #66cc66">(</span><span style="color: #ff0000">"mapbg"</span>,<span style="color: #cc66cc">3</span><span style="color: #66cc66">)</span>;<span style="font-style: italic; color: #808080">//创建背景地图mc</span> <span style="color: blue">_root</span>.<span style="color: blue">createEmptyMovieClip</span><span style="color: #66cc66">(</span><span style="color: #ff0000">"pathshadow"</span>,<span style="color: #cc66cc">4</span><span style="color: #66cc66">)</span>;<span style="font-style: italic; color: #808080">//创建路径显示mc</span> mapbg.<span style="color: blue">useHandCursor</span>; <span style="font-style: italic; color: #808080">//=======================================画方块函数</span> drawbox = <span style="color: #0000ff">function</span> <span style="color: #66cc66">(</span>obj, x, y, f<span style="color: #66cc66">)</span> <span style="color: #66cc66">{</span> <span style="color: #0000ff">var</span> drawx = x<span style="color: #66cc66">*</span><span style="color: #cc66cc">20</span>; <span style="color: #0000ff">var</span> drawy = y<span style="color: #66cc66">*</span><span style="color: #cc66cc">20</span>; <span style="color: blue">with</span> <span style="color: #66cc66">(</span>obj<span style="color: #66cc66">)</span> <span style="color: #66cc66">{</span> <span style="color: blue">lineStyle</span><span style="color: #66cc66">(</span><span style="color: #cc66cc">1</span>,0xcccccc,<span style="color: #cc66cc">100</span><span style="color: #66cc66">)</span>; <span style="color: blue">moveTo</span><span style="color: #66cc66">(</span>drawx,drawy<span style="color: #66cc66">)</span>; <span style="color: blue">beginFill</span><span style="color: #66cc66">(</span>f,<span style="color: #cc66cc">100</span><span style="color: #66cc66">)</span>; <span style="color: blue">lineTo</span><span style="color: #66cc66">(</span>drawx+<span style="color: #cc66cc">20</span>,drawy<span style="color: #66cc66">)</span>; <span style="color: blue">lineTo</span><span style="color: #66cc66">(</span>drawx+<span style="color: #cc66cc">20</span>,drawy+<span style="color: #cc66cc">20</span><span style="color: #66cc66">)</span>; <span style="color: blue">lineTo</span><span style="color: #66cc66">(</span>drawx,drawy+<span style="color: #cc66cc">20</span><span style="color: #66cc66">)</span>; <span style="color: blue">lineTo</span><span style="color: #66cc66">(</span>drawx,drawy<span style="color: #66cc66">)</span>; <span style="color: blue">endFill</span><span style="color: #66cc66">(</span><span style="color: #66cc66">)</span>; <span style="color: #66cc66">}</span> <span style="color: #66cc66">}</span>; <span style="font-style: italic; color: #808080">//=======================================在mapbg中生成随机地图,并把数据存进mmap</span> <span style="color: #0099cc">for</span> <span style="color: #66cc66">(</span>a=<span style="color: #cc66cc">0</span>; a<span style="color: #66cc66"><</span>ny; a++<span style="color: #66cc66">)</span> <span style="color: #66cc66">{</span> mmap<span style="color: #66cc66">[</span>a<span style="color: #66cc66">]</span> = <span style="color: #0000ff">new</span> <span style="color: blue">Array</span><span style="color: #66cc66">(</span>nx<span style="color: #66cc66">)</span>; fmap<span style="color: #66cc66">[</span>a<span style="color: #66cc66">]</span> = <span style="color: #0000ff">new</span> <span style="color: blue">Array</span><span style="color: #66cc66">(</span>nx<span style="color: #66cc66">)</span>; <span style="color: #0099cc">for</span> <span style="color: #66cc66">(</span>b=<span style="color: #cc66cc">0</span>; b<span style="color: #66cc66"><</span>nx; b++<span style="color: #66cc66">)</span> <span style="color: #66cc66">{</span> <span style="color: #0099cc">if</span> <span style="color: #66cc66">(</span>a == <span style="color: #cc66cc">0</span> <span style="color: #66cc66">&&</span> b == <span style="color: #cc66cc">0</span><span style="color: #66cc66">)</span> <span style="color: #66cc66">{</span> mmap<span style="color: #66cc66">[</span>a<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span>b<span style="color: #66cc66">]</span> = <span style="color: #cc66cc">0</span>; <span style="color: #66cc66">}</span> <span style="color: #0099cc">else</span> <span style="color: #66cc66">{</span> mmap<span style="color: #66cc66">[</span>a<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span>b<span style="color: #66cc66">]</span> = <span style="color: blue">random</span><span style="color: #66cc66">(</span><span style="color: #cc66cc">2</span><span style="color: #66cc66">)</span><span style="color: #66cc66">*</span><span style="color: blue">random</span><span style="color: #66cc66">(</span><span style="color: #cc66cc">2</span><span style="color: #66cc66">)</span><span style="color: #66cc66">*</span><span style="color: blue">random</span><span style="color: #66cc66">(</span><span style="color: #cc66cc">2</span><span style="color: #66cc66">)</span>; <span style="color: #66cc66">}</span> fmap<span style="color: #66cc66">[</span>a<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span>b<span style="color: #66cc66">]</span> = mmap<span style="color: #66cc66">[</span>a<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span>b<span style="color: #66cc66">]</span>; <span style="color: #0099cc">if</span> <span style="color: #66cc66">(</span>mmap<span style="color: #66cc66">[</span>a<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span>b<span style="color: #66cc66">]</span> == <span style="color: #cc66cc">0</span><span style="color: #66cc66">)</span> <span style="color: #66cc66">{</span> drawbox<span style="color: #66cc66">(</span>mapbg,b,a,0xeeeeee<span style="color: #66cc66">)</span>; <span style="color: #66cc66">}</span> <span style="color: #0099cc">else</span> <span style="color: #66cc66">{</span> drawbox<span style="color: #66cc66">(</span>mapbg,b,a,0xbbbbbb<span style="color: #66cc66">)</span>; <span style="color: #66cc66">}</span> <span style="color: #66cc66">}</span> <span style="color: #66cc66">}</span> <span style="font-style: italic; color: #808080">//=======================================创建一个代表人的小圆元件,用在地图上行走</span> <span style="color: blue">_root</span>.<span style="color: blue">createEmptyMovieClip</span><span style="color: #66cc66">(</span><span style="color: #ff0000">"man"</span>,<span style="color: #cc66cc">5</span><span style="color: #66cc66">)</span>; <span style="color: blue">with</span> <span style="color: #66cc66">(</span><span style="color: blue">_root</span>.<span style="color: #006600">man</span><span style="color: #66cc66">)</span> <span style="color: #66cc66">{</span> <span style="color: blue">lineStyle</span><span style="color: #66cc66">(</span><span style="color: #cc66cc">1</span>,0xff9900,<span style="color: #cc66cc">100</span><span style="color: #66cc66">)</span>; <span style="color: blue">beginFill</span><span style="color: #66cc66">(</span>0xff9900<span style="color: #66cc66">)</span>; <span style="color: blue">moveTo</span><span style="color: #66cc66">(</span><span style="color: #cc66cc">0</span>,<span style="color: #cc66cc">10</span><span style="color: #66cc66">)</span>; <span style="color: blue">curveTo</span><span style="color: #66cc66">(</span><span style="color: #cc66cc">0</span>,<span style="color: #cc66cc">0</span>,<span style="color: #cc66cc">10</span>,<span style="color: #cc66cc">0</span><span style="color: #66cc66">)</span>; <span style="color: blue">curveTo</span><span style="color: #66cc66">(</span><span style="color: #cc66cc">20</span>,<span style="color: #cc66cc">0</span>,<span style="color: #cc66cc">20</span>,<span style="color: #cc66cc">10</span><span style="color: #66cc66">)</span>; <span style="color: blue">curveTo</span><span style="color: #66cc66">(</span><span style="color: #cc66cc">20</span>,<span style="color: #cc66cc">20</span>,<span style="color: #cc66cc">10</span>,<span style="color: #cc66cc">20</span><span style="color: #66cc66">)</span>; <span style="color: blue">curveTo</span><span style="color: #66cc66">(</span><span style="color: #cc66cc">0</span>,<span style="color: #cc66cc">20</span>,<span style="color: #cc66cc">0</span>,<span style="color: #cc66cc">10</span><span style="color: #66cc66">)</span>; <span style="color: blue">endFill</span><span style="color: #66cc66">(</span><span style="color: #66cc66">)</span>; <span style="color: #66cc66">}</span> <span style="font-style: italic; color: #808080">//===================</span> <span style="color: #0000ff">var</span> bx = <span style="color: #cc66cc">0</span>; <span style="color: #0000ff">var</span> by = <span style="color: #cc66cc">0</span>; <span style="color: #0000ff">var</span> ex = <span style="color: #cc66cc">0</span>; <span style="color: #0000ff">var</span> ey = <span style="color: #cc66cc">0</span>; <span style="font-style: italic; color: #808080">//========================================鼠标点下的时候进行广度搜索</span> <span style="color: blue">_root</span>.<span style="color: blue">onMouseDown</span> = <span style="color: #0000ff">function</span><span style="color: #66cc66">(</span><span style="color: #66cc66">)</span> <span style="color: #66cc66">{</span> bx = <span style="color: blue">int</span><span style="color: #66cc66">(</span><span style="color: blue">_xmouse</span><span style="color: #66cc66">/</span><span style="color: #cc66cc">20</span><span style="color: #66cc66">)</span>;<span style="font-style: italic; color: #808080">//取得鼠标点下的格坐标及人的当前准备搜索</span> by = <span style="color: blue">int</span><span style="color: #66cc66">(</span><span style="color: blue">_ymouse</span><span style="color: #66cc66">/</span><span style="color: #cc66cc">20</span><span style="color: #66cc66">)</span>; ex = <span style="color: blue">int</span><span style="color: #66cc66">(</span>man.<span style="color: blue">_x</span><span style="color: #66cc66">/</span><span style="color: #cc66cc">20</span><span style="color: #66cc66">)</span>; ey = <span style="color: blue">int</span><span style="color: #66cc66">(</span>man.<span style="color: blue">_y</span><span style="color: #66cc66">/</span><span style="color: #cc66cc">20</span><span style="color: #66cc66">)</span>; finded = <span style="color: #0000ff">false</span>;<span style="font-style: italic; color: #808080">//搜索成功标志清掉</span> pathshadow.<span style="color: blue">clear</span><span style="color: #66cc66">(</span><span style="color: #66cc66">)</span>;<span style="font-style: italic; color: #808080">//路径阴影清空</span> <span style="color: #0099cc">for</span> <span style="color: #66cc66">(</span>a=<span style="color: #cc66cc">0</span>; a<span style="color: #66cc66"><</span>ny; a++<span style="color: #66cc66">)</span> <span style="color: #66cc66">{</span> <span style="color: #0099cc">for</span> <span style="color: #66cc66">(</span>b=<span style="color: #cc66cc">0</span>; b<span style="color: #66cc66"><</span>nx; b++<span style="color: #66cc66">)</span> <span style="color: #66cc66">{</span> fmap<span style="color: #66cc66">[</span>a<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span>b<span style="color: #66cc66">]</span> = mmap<span style="color: #66cc66">[</span>a<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span>b<span style="color: #66cc66">]</span>; <span style="color: #66cc66">}</span> <span style="color: #66cc66">}</span><span style="font-style: italic; color: #808080">//障碍及搜索过的结点标志数组重置</span> vmap.<span style="color: blue">splice</span><span style="color: #66cc66">(</span><span style="color: #cc66cc">0</span><span style="color: #66cc66">)</span>;<span style="font-style: italic; color: #808080">//结点存储数组清空</span> <span style="color: #0099cc">if</span> <span style="color: #66cc66">(</span>fmap<span style="color: #66cc66">[</span>by<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span>bx<span style="color: #66cc66">]</span> == <span style="color: #cc66cc">0</span><span style="color: #66cc66">)</span> <span style="color: #66cc66">{</span><span style="font-style: italic; color: #808080">//目标格为空格时才保存为广度搜索根结点</span> vmap<span style="color: #66cc66">[</span><span style="color: #cc66cc">1</span><span style="color: #66cc66">]</span> = <span style="color: #66cc66">[</span>bx, by, <span style="color: #cc66cc">1</span>, <span style="color: #cc66cc">0</span><span style="color: #66cc66">]</span>; fmap<span style="color: #66cc66">[</span>by<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span>bx<span style="color: #66cc66">]</span> = <span style="color: #cc66cc">1</span>; <span style="color: #66cc66">}</span> p = <span style="color: #cc66cc">1</span>; i = <span style="color: #cc66cc">1</span>; <span style="color: #0099cc">while</span> <span style="color: #66cc66">(</span>vmap<span style="color: #66cc66">[</span>i<span style="color: #66cc66">]</span> <span style="color: #66cc66">!</span>= <span style="color: blue">undefined</span><span style="color: #66cc66">)</span> <span style="color: #66cc66">{</span><span style="font-style: italic; color: #808080">//广度搜索,根结点开始,每个结点四个方向如果为空格而且还没搜索过就把坐标和到根结点的距离及父结点记录进vmap</span> <span style="color: #0099cc">for</span> <span style="color: #66cc66">(</span>t=<span style="color: #cc66cc">0</span>; t<span style="color: #66cc66"><</span><span style="color: #cc66cc">4</span>; t++<span style="color: #66cc66">)</span> <span style="color: #66cc66">{</span> <span style="color: #0099cc">if</span> <span style="color: #66cc66">(</span>fmap<span style="color: #66cc66">[</span>vmap<span style="color: #66cc66">[</span>i<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">1</span><span style="color: #66cc66">]</span>+parrow<span style="color: #66cc66">[</span>t<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">1</span><span style="color: #66cc66">]</span><span style="color: #66cc66">]</span><span style="color: #66cc66">[</span>vmap<span style="color: #66cc66">[</span>i<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">0</span><span style="color: #66cc66">]</span>+parrow<span style="color: #66cc66">[</span>t<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">0</span><span style="color: #66cc66">]</span><span style="color: #66cc66">]</span> == <span style="color: #cc66cc">0</span><span style="color: #66cc66">)</span> <span style="color: #66cc66">{</span> p++; vmap<span style="color: #66cc66">[</span>p<span style="color: #66cc66">]</span> = <span style="color: #66cc66">[</span>vmap<span style="color: #66cc66">[</span>i<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">0</span><span style="color: #66cc66">]</span>+parrow<span style="color: #66cc66">[</span>t<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">0</span><span style="color: #66cc66">]</span>, vmap<span style="color: #66cc66">[</span>i<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">1</span><span style="color: #66cc66">]</span>+parrow<span style="color: #66cc66">[</span>t<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">1</span><span style="color: #66cc66">]</span>, vmap<span style="color: #66cc66">[</span>i<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">2</span><span style="color: #66cc66">]</span>+<span style="color: #cc66cc">1</span>, i<span style="color: #66cc66">]</span>; fmap<span style="color: #66cc66">[</span>vmap<span style="color: #66cc66">[</span>i<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">1</span><span style="color: #66cc66">]</span>+parrow<span style="color: #66cc66">[</span>t<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">1</span><span style="color: #66cc66">]</span><span style="color: #66cc66">]</span><span style="color: #66cc66">[</span>vmap<span style="color: #66cc66">[</span>i<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">0</span><span style="color: #66cc66">]</span>+parrow<span style="color: #66cc66">[</span>t<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">0</span><span style="color: #66cc66">]</span><span style="color: #66cc66">]</span> = <span style="color: #cc66cc">1</span>; <span style="color: #66cc66">}</span> <span style="color: #66cc66">}</span> <span style="color: #0099cc">if</span> <span style="color: #66cc66">(</span>vmap<span style="color: #66cc66">[</span>i<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">0</span><span style="color: #66cc66">]</span> == ex <span style="color: #66cc66">&&</span> vmap<span style="color: #66cc66">[</span>i<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">1</span><span style="color: #66cc66">]</span> == ey<span style="color: #66cc66">)</span> <span style="color: #66cc66">{</span> finded = <span style="color: #0000ff">true</span>; cp = i; <span style="color: #0099cc">break</span>; <span style="color: #66cc66">}</span> <span style="font-style: italic; color: #808080">//找到了路径就马上退出搜索,置搜索成功标志,并记录最后搜索到的结点索引</span> i++; <span style="color: #66cc66">}</span> tempcp = cp; <span style="color: #0099cc">if</span> <span style="color: #66cc66">(</span>finded<span style="color: #66cc66">)</span> <span style="color: #66cc66">{</span><span style="font-style: italic; color: #808080">//搜索成功就画出路径阴影</span> <span style="color: #0099cc">while</span> <span style="color: #66cc66">(</span>tempcp<span style="color: #66cc66">></span>=<span style="color: #cc66cc">1</span><span style="color: #66cc66">)</span> <span style="color: #66cc66">{</span> drawbox<span style="color: #66cc66">(</span>pathshadow,vmap<span style="color: #66cc66">[</span>tempcp<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">0</span><span style="color: #66cc66">]</span>,vmap<span style="color: #66cc66">[</span>tempcp<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">1</span><span style="color: #66cc66">]</span>,0xccff99<span style="color: #66cc66">)</span>; tempcp = vmap<span style="color: #66cc66">[</span>tempcp<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">3</span><span style="color: #66cc66">]</span>; <span style="color: #66cc66">}</span> <span style="color: #66cc66">}</span> <span style="color: #66cc66">}</span>; <span style="font-style: italic; color: #808080">//=====================================定时自运行函数,当找到路径后将代表人的圆mc一步步按路径走向目标点。</span> mango = <span style="color: #0000ff">function</span> <span style="color: #66cc66">(</span><span style="color: #66cc66">)</span> <span style="color: #66cc66">{</span> <span style="color: #0099cc">if</span> <span style="color: #66cc66">(</span>finded<span style="color: #66cc66">)</span> <span style="color: #66cc66">{</span> cp = vmap<span style="color: #66cc66">[</span>cp<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">3</span><span style="color: #66cc66">]</span>; man.<span style="color: blue">_x</span> = <span style="color: #cc66cc">20</span><span style="color: #66cc66">*</span>vmap<span style="color: #66cc66">[</span>cp<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">0</span><span style="color: #66cc66">]</span>; man.<span style="color: blue">_y</span> = <span style="color: #cc66cc">20</span><span style="color: #66cc66">*</span>vmap<span style="color: #66cc66">[</span>cp<span style="color: #66cc66">]</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">1</span><span style="color: #66cc66">]</span>; <span style="color: #0099cc">if</span> <span style="color: #66cc66">(</span>cp == <span style="color: #cc66cc">1</span><span style="color: #66cc66">)</span> <span style="color: #66cc66">{</span> pathshadow.<span style="color: blue">clear</span><span style="color: #66cc66">(</span><span style="color: #66cc66">)</span>; finded = <span style="color: #0000ff">false</span>; <span style="color: #66cc66">}</span> <span style="font-style: italic; color: #808080">//行走结束的时候把路径阴影清空</span> <span style="color: #66cc66">}</span> <span style="color: #66cc66">}</span>; <span style="color: blue">setInterval</span><span style="color: #66cc66">(</span>mango,<span style="color: #cc66cc">50</span><span style="color: #66cc66">)</span>;</pre> </td> </tr> </tbody> </table> </div>
试试其它关键字
寻路算法
同语言下
.
从网络服务器上下载DLL文件
.
flex音乐播放器
.
关机小脚本
.
Flash获取当前文件名、路径名
.
按中文字母排序
.
AS3 混淆加密
.
中国象棋博弈树搜索算法
.
获得当前flash文件加载的URL
.
AS2寻路算法
.
AS3中使用摄像头
可能有用的
.
C#实现的html内容截取
.
List 切割成几份 工具类
.
SQL查询 多列合并成一行用逗号隔开
.
一行一行读取txt的内容
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
Java PDF转换成图片并输出给前台展示
.
网站后台修改图片尺寸代码
.
处理大图片在缩略图时的展示
贡献的其它代码
Label
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3