| // 显示棋子
_root.display = "Xpos : " + (x +
1);
temp = chr ( y + 65);
_root.display1 = "Ypos : " + temp;
_root.playnow = "player";
//判断是否获胜
xx = x;
yy = y;
for (k=0; k<4; k++) {
if (_root.a_result <> 6) {
_root.a_result = 0;
x = xx;
y = yy;
while ((_root.table[y][x] == 2) and (y+_root.dir[k][1]
< 16) and (x+_root.dir[k][0] >= -1) and
(x+_root.dir[k][0] < 16) and (y+_root.dir[k][1]
>= -1)) {
x = x + _root.dir[k][0];
y = y + _root.dir[k][1];
// "_root.table["+y+"]["+x+"]="+_root.table[y][x]
_root.a_result = _root.a_result+1;
}
x = xx;
y = yy;
while ((_root.table[y][x] == 2) and (y+_root.dir[k+4][1]
< 16) and (x+_root.dir[k+4][0] >= -1)
and (x+_root.dir[k+4][0] < 16) and (y+_root.dir[k+4][1]
>= -1)) {
x = x + _root.dir[k+4][0];
y = y + _root.dir[k+4][1];
_root.a_result = _root.a_result+1;
}
if (_root.a_result == 6) {
_root.playnow = "nobody";
}
}
}
if (_root.playnow =="nobody") {
_root.gameoverman.gotoAndPlay(2);
}
}
|