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)方法解决了这个问题 调用方法事方法写错 没进行算法计算。
     
     
     
  • 相关阅读:
    git使用总结
    将本地项目上传到git
    ASP.NET MVC中注册Global.asax的Application_Error事件处理全局异常
    SQLQueryStress
    SQL Server 触发器
    HTTP 错误 404.3
    HTTP 错误 500.19 Internal Server Error的解决方法
    windows server 2012 配置多用户ftp服务器配置注意点
    自定义Remote验证(对博客园文章“Asp.net MVC验证哪些事(3)-- Remote验证及其改进(附源码)”自定义验证的改进)
    [ASP.net教程]IIS服务器 远程发布(Web Deploy)配置
  • 原文地址:https://www.cnblogs.com/paoxiaodedaxuongmao/p/7740120.html
Copyright © 2011-2022 走看看