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)方法解决了这个问题 调用方法事方法写错 没进行算法计算。
     
     
     
  • 相关阅读:
    MySql存储过程—2、第一个MySql存储过程的建立
    MYSQL 存储过程1、SQL存储过程的基础知识
    [转]忍无可忍 献上一曲维族歌曲 《我们的客户是花园》(吐槽)
    由硬盘供电不稳、数据线品质差造成的蓝屏
    music Elton John
    一个人在艰苦中能雄起,那是能力和毅力,一个人在安逸中能雄起,那是自觉和自律。
    安装VS2012出问题后,反复重启电脑。
    山寨、低端、劣质的机箱前置面板的悲剧。
    SQL Server Management Studio (SSMS) 清除登录记录
    DataTable 分批处理,每批处理4行
  • 原文地址:https://www.cnblogs.com/paoxiaodedaxuongmao/p/7740120.html
Copyright © 2011-2022 走看看