//控制棋盤(pán)大小,應(yīng)小于 26*50 var num_row = 11; var num_col = 15;
//控制單元個(gè)大小 var unit_width = 35; var unit_height = 35;
//定制棋子屬性 function chessman(img,name,speed,life,att,def,luck)
//自定義棋子 var chessman_list = new Array(); //Attrib list (20): img, name, speed, life, att, def, luck chessman_list.push(["icon10.gif", "general", 3, 100, 4, 9, 4]); chessman_list.push(["icon11.gif", "Colonel", 4, 90, 6, 9, 1]); chessman_list.push(["icon12.gif", "Major", 1, 80, 9, 1, 9]); chessman_list.push(["icon6.gif", "Captain", 2, 60, 4, 6, 8]); chessman_list.push(["icon7.gif", "Sergeant", 6, 40, 7, 2, 5]); chessman_list.push(["icon8.gif", "Corporal", 5, 25, 3, 9, 3]); chessman_list.push(["icon9.gif", "Private", 8, 10, 2, 2, 8]);
//生成棋子,并安放位置 function Build_troop()
//讀取棋子(址傳遞,可直接修改屬性) function Get_chessman(the_chessman)
//AI 函數(shù) function AI_move(the_chessman)
//吃子規(guī)則 function Att_rule()
以上僅僅列舉了主要的可定制成分,歡迎修改,其他的過(guò)程函數(shù)請(qǐng)參見(jiàn)程序內(nèi)注釋?zhuān)惶宄脑?huà)直接問(wèn)我。
運(yùn)行代碼框
[Ctrl+A 全部選擇 提示:你可先修改部分代碼,再按運(yùn)行]
歡迎到論壇中討論。http://www.95time.cn/bbs
出處:藍(lán)色理想
責(zé)任編輯:panliu888
◎進(jìn)入論壇網(wǎng)頁(yè)制作、網(wǎng)站綜合版塊參加討論
|