|
楼主 |
发表于 2012-9-4 15:17:35
|
显示全部楼层
本帖最后由 jicker 于 2012-9-4 03:24 PM 编辑
case "uq_maze1": // ^┌─┬─┬─┬─┬─┬─┬─┬─┐
set("uquest/line", 0);
uq_maze.init();
break;
case "uq_maze2": // ^└─┴─┴─┴─┴─┴─┴─┴─┘
var path = uq_maze.goto(uq_maze.end);
world.note("uq_maze2:" + path);
do_walk(path.split(";"), "step");
break;
case "uq_maze3": // ^├(.*)┼(.*)┼(.*)┼(.*)┼(.*)┼(.*)┼(.*)┼(.*)┤
var tmp = "";
var cot = query("uquest/line");
for (var i=0; i<8; i++) {
if (wcs != "─") {
uq_maze.addexit(cot*8+i, "s");
uq_maze.addexit(cot*8+i+8, "n");
}
}
set("uquest/line", cot+1);
break;
case "uq_maze4": // ^│(.*)│
var cot = query("uquest/line");
var str = wcs[0];
for (var i=0; i<7; i++) {
if (str.charAt(2*i+1) != "│") {
uq_maze.addexit(cot*8+i, "e");
uq_maze.addexit(cot*8+i+1, "w");
}
if (str.charAt(2*i) == "★") uq_maze.cloc = cot*8+i;
}
if (str.charAt(14) == "★") uq_maze.cloc = cot*8+7;
var loc = -1;
var lin = world.GetLinesInBufferCount();
var sty = world.GetLineInfo(lin, 11);
for (var j=1; j<=sty; j++) {
len = world.GetStyleInfo(lin, j, 2);
bcor = world.GetStyleInfo(lin, j, 15);
if (bcor == 16777215) uq_maze.start = cot*8 + loc/2;
if (bcor == 128) uq_maze.end = cot*8 + loc/2;
loc += len/2;
}
break;
请教这段代码哪里出错了?迷宫路径计算不出来。 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|