zoukankan      html  css  js  c++  java
  • 团队-象棋游戏3-模块开发过程

    项目托管平台地址:https://gitee.com/zhanghongjian666/ZhongGuoXiangQi/blob/0156ad731ab887b252ada203757058ba78b029e4/zgxq.html
    开发模块功能:
    棋子加载功能,开发时间:10天(小时),实现棋子的加载,
    实现过程是
    var QiZi function (qipanrctextisred{
    this.text text;
    this.isred isred;
    this.ctx qipan.ctx;
    this.qipan qipan;
    this.r;
    this.c;
     
     
    this.draw();
    var that thismaxR that.qipan.maxRmaxC that.qipan.maxC;
    this.checkstep (function () {
     
     
    if (text == "兵" || text == "卒"{
    if (that.4{
     
     
    return function (rc{
    return this.&& (this.1== && this.== c
    || this.<= && this.== && ((this.1== || (this.1== c)
    || this.<= && (this.1== && this.== c;
    }
     
     
    else {
    return function (rc{
    return this.&& (this.1== && this.== || this.>= && this.== && ((this.1== || (this.1== c|| this.>= && (this.1== && this.== c;
    }
    }
     
     
    else if (text == "炮"{
    return function (rc{
    if (this.!= && this.!= c{
    return false;
    }
    var bodys this.qipan.bodysstep this.getMoveRange(rc);
     
     
    return bodys[r][c].qizi != null && step == || bodys[r][c].qizi == null && step == 0;
     
     
    }
    else if (text == "车" || text == "車"{
    return function (rc{
    if (this.!= && this.!= c{
    return false;
    }
    return this.getMoveRange(rc== 0;
     
     
    }
    else if (text == "马" || text == "馬"{
    return function (rc{
     
     
    return this.== && this.== && this.isEnemyOrEmpty(this.1this.c)
    || this.== && this.== && this.isEnemyOrEmpty(this.1this.c)
    || this.== && this.== && this.isEnemyOrEmpty(this.1this.c)
    || this.== && this.== && this.isEnemyOrEmpty(this.1this.c)
    || this.== && this.== && this.isEnemyOrEmpty(this.rthis.1)
    || this.== && this.== && this.isEnemyOrEmpty(this.rthis.1)
    || this.== && this.== && this.isEnemyOrEmpty(this.rthis.1)
    || this.== && this.== && this.isEnemyOrEmpty(this.rthis.1)
    ;
    }
    else if (text == "相" || text == "象"{
    return function (rc{
    return this.== && this.== && this.isEnemyOrEmpty(this.1this.1)
    || this.== && this.== && this.isEnemyOrEmpty(this.1this.1)
    || this.== && this.== && this.isEnemyOrEmpty(this.1this.1)
    || this.== && this.== && this.isEnemyOrEmpty(this.1this.1)
    ;
    }
    else if (text == "士" || text == "仕"{
    if (that.4{
    return function (rc{
    var 7l2 93b2 5;
    if (|| l2 || || b2{
    return false;
    }
    return this.== && this.== c
    || this.== && this.== c
    || this.== && this.== c
    || this.== && this.== c
    ;
    }
    else {
    return function (rc{
    var 0l2 33b2 5;
    if (|| l2 || || b2{
    return false;
    }
    return this.== && this.== c
    || this.== && this.== c
    || this.== && this.== c
    || this.== && this.== c
    ;
    }
    }
     
     
    else if (text == "将" || text == "帅"{
    if (that.4{
    return function (rc{
    var 7l2 93b2 5;
    if (|| l2 || || b2{
    return false;
    }
    return this.== && this.== c
    || this.== && this.== c
    || this.== && this.== c
    || this.== && this.== c
    ;
    }
    else {
    return function (rc{
    var 0l2 23b2 5;
    if (|| l2 || || b2{
    return false;
    }
    return this.== && this.== c
    || this.== && this.== c
    || this.== && this.== c
    || this.== && this.== c
    ;
    }
    }
    }
    return function () {
     
     
    };
     
     
    }());
    }
    QiZi.prototype {
    isEnemyOrEmptyfunction (rc{
    return this.qipan.bodys[r][c].qizi == null;
    },

    开发炮的功能时遇到了能在错误的规则下吃掉其他子问题,最终使用this.getMoveRange(r, c)方法解决了这个问题 调用方法事方法写错 没进行算法计算。
     
     
     
  • 相关阅读:
    redolog switch会发生完全检查点还是增量检查点?
    4G牌照发放生变 专家谏言电信联通如何选择
    [财富]iPhone如何征服日本?
    审计中移动现多处问题或致地方高层落马
    诺基亚CEO:Lumia不会像安卓推廉价版机型
    菜鸟学JDBC(二)
    简易网页采集器的实现
    手Q与微信:最终结局将会是手足相残!
    做网站Http状态码详解
    PHP $_SERVER['HTTP_REFERER'] 获取前一页面的 URL 地址
  • 原文地址:https://www.cnblogs.com/paoxiaodedaxuongmao/p/7740120.html
Copyright © 2011-2022 走看看