搜索文章:

首页  |  Java技术  |  Asp.net  |  Asp编程  |  VC/C++  |  Delphi  |  VB编程

JS 小游戏

//控制棋盘大小,应小于 26*50
var num_row = 11;
var num_col = 15;

//控制单元个大小
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 函数
function ai_move(the_chessman)

//吃子规则
function att_rule()

以上仅仅列举了主要的可定制成分,欢迎修改,其他的过程函数请参见程序内注释,不太清楚的话直接问我。

运行代码框

[ctrl+a 全部选择 提示:你可先修改部分代码,再按运行]

()

相关文章:
© 2006   www.java-asp.net