欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

Flash游戲制作--五子連珠(二)

系統 1610 0

// 顯示棋子
_root.display = "Xpos : " + (x + 1);
temp = chr ( y + 65);
_root.display1 = "Ypos : " + temp;
_root.playnow = "player";
//判斷是否獲勝
xx = x;
yy = y;
for (k=0; k 6) {
_root.a_result = 0;
x = xx;
y = yy;
while ((_root.table[y][x] == 2) and (y+_root.dir[k][1] = -1) and (x+_root.dir[k][0] = -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] = -1) and (x+_root.dir[k+4][0] = -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);
}
}
C:新建一個Movie clip組件,并命名為bb,此組件用來計算電腦如何走棋,進入組件編輯狀態后,在圖層layer1繪制一個有填充色的矩形,然后在第5楨插入一個關鍵楨,在同樣位置繪制一個大小相同填充色不同的矩形。新建一個圖層,在矩形里輸入提示文字:電腦走棋,然后再新建一個圖層Action,在第一楨添加AS: stop();,在第8楨插入一個關鍵楨,在此楨添加如下AS:
if (_root.playnow == "computer") {
//初始化棋盤
_root.func.makelist("white");
_root.func.makelist("black");
//調用自定義函數
max_computer = 0;
max_player = 0;
k = 0;
//定義三變量
for (j=0; j 50) {
max_computer = _root.computer[j*15+i][k] ;
xc = i;
yc = j;
}
}
if (_root.computer[j*15+i][k] > max_computer) {
max_computer = _root.computer[j*15+i][k] ;
xc = i;
yc = j;
}
if (_root.player[j*15+i][k] > max_player) {
max_player = _root.player[j*15+i][k] ;
xp = i;
yp = j;
}
}
}
}
if (max_computer > max_player) {
x = xc;
y = yc;
} else {
x = xp;
y = yp;
}
// 繪制棋子
num = y * 15 + x;
removeMovieClip(_root.b add num);
duplicateMovieClip(_root.white, "white" add num, num + 300);
setProperty(_root.white add num, _x, 34.7 + x * 20);
setProperty(_root.white add num, _y, 34.7 + y * 20);
_root.table[y][x] = 2;
// 顯示棋子
_root.display = "Xpos : " + (x + 1);
temp = chr ( y + 65);
_root.display1 = "Ypos : " + temp;
_root.playnow = "player";
// 判斷是否獲勝
xx = x;
yy = y;
for (k=0; k 6) {
_root.a_result = 0;
x = xx;
y = yy;
while ((_root.table[y][x] == 2) and (y+_root.dir[k][1] = -1) and (x+_root.dir[k][0] = -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] = -1) and (x+_root.dir[k+4][0] = -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);
}
}
最后的時間線如圖6所示:

本文轉自:http://www.5uflash.com/flashjiaocheng/Flashyingyongkaifa/797.html

Flash游戲制作--五子連珠(二)


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 欧美久在线观看在线观看 | 日本一区二区三区免费观看 | 91精品网| 一级性视频| 色偷偷精品视频在线播放放 | 成人免费毛片视频 | 久草在线播放视频 | 国产精品系列在线 | 99热久 | 伊人9999| av资源首页 | 国产精品亚洲综合第一区 | 国产1区在线| 国产vr一区二区在线观看 | 亚洲 欧美 另类 综合 偷拍 | 99久久精品久久久久久清纯 | 欧美自拍视频在线 | 成人黄色在线 | 国产一区二区在线免费观看 | 国产chinese视频在线观看 | 亚洲娇小性xxxx色 | 日本高清视频在线播放 | 久久婷婷在线 | 精品国产欧美一区二区 | 日韩福利视频导航 | 蜜桃91麻豆 | 美国免费一级片 | 奇米777me | 久久999视频| 国产三级在线观看 | 欧美日剧在线免费 | 麻豆国产一区二区三区四区 | 天天操天天摸天天舔 | 日本粉嫩一区二区三区视频 | 亚洲最大成人综合 | 91av在线免费视频 | 就草草在线观看视频 | 亚洲成人精品 | 97日日摸天天碰免费视频 | 91短视频版在线观看免费大全 | 国产精品成人va在线观看入口 |