全文预览

Flash AS3.0搜索AStar最短路径 制作:TittupFrog(跳跳蛙)

上传者:塑料瓶子 |  格式:doc  |  页数:7 |  大小:0KB

文档介绍
; j < w; j++)Р {Р var b = new Block();Р addChild(b);Р b.locX = i;Р b.locY = j;Р b.isroad = true;Р b.x = 40 + 40 * j;Р b.y = 40 + 40 * i;Р b.addEventListener(MouseEvent.CLICK, release);Р function release(event)Р {Р var c = event.currentTarget;Р c.isroad = !c.isroad;Р if (setscr)Р {Р setscr = false;Р if (sx != -1 && sy != -1)Р {Р block[sx][sy].isroad = true;Р block[sx][sy].gotoAndStop(1);Р }Р sx = c.locX;Р sy = c.locY;Р c.isroad = true;Р c.gotoAndStop(2);Р }Р else if (setdst)Р {Р setdst = false;Р if (dx != -1 && dy != -1)Р {Р block[dx][dy].isroad = true;Р block[dx][dy].gotoAndStop(1);Р }Р dx = c.locX;Р dy = c.locY;Р c.isroad = true;Р c.gotoAndStop(3);Р }Р elseР {Р c.gotoAndStop(c.isroad ? 1 : 5);Р }Р }Р block[i][j] = b;Р }Р }Р }Р?}Р}Р 作者:TittupFrog(跳跳蛙)Р 邮箱: mailto:TittupFrog@Р 制作日期:2015-4-6

收藏

分享

举报
下载此文档