疯狂的方块

欢迎来到程序小院

疯狂的方块

玩法:两个以上相同颜色的方块连在一起,点击即可消除,不要让方块到达顶部,消除底部方块哦^^。

开始游戏icon-default.png?t=N7T8https://www.ormcc.com/play/gameStart/263

html

<div id="gameDiv">
<canvas id="gameCanvas" width="480" height="640"></canvas>
</div>

css

body {
  text-align: center;
  background: #fff;
  padding: 0;
  border: 0;
  margin: 0;
  height: 100%;
}
html {
  -ms-touch-action: none;
}
.aliForPc {
  display:none;
  position:fixed;
  top:5px;
  right:5px;
  width:200px;
  height:230px;
  overflow:hidden;
  z-index:99999;
}

js

!function(){
  window.egret = {};
  (function(b) {
      var d = function() {
          function b() {
              this._hashCode = b.hashCount++
          }
          Object.defineProperty(b.prototype, "hashCode", {
              get: function() {
                  return this._hashCode
              },
              enumerable: !0,
              configurable: !0
          });
          b.hashCount = 1;
          return b
      }();
      b.HashObject = d;
      d.prototype.__class__ = "egret.HashObject"
  })(egret);
  var __extends = this.__extends || function(b, d) {
      function c() {
          this.constructor = b
      }
      for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
      c.prototype = d.prototype;
      b.prototype = new c
  };
  (function(b) {
      var d = function(b) {
          function a(e) {
              "undefined" === typeof e && (e = 300);
              b.call(this);
              this.objectPool = [];
              this._length = 0;
              1 > e && (e = 1);
              this.autoDisposeTime = e;
              this.frameCount = 0
          }
          __extends(a, b);
          a.prototype._checkFrame = function() {
              this.frameCount--;
              0 >= this.frameCount && this.dispose()
          };
          Object.defineProperty(a.prototype, "length", {
              get: function() {
                  return this._length
              },
              enumerable: !0,
              configurable: !0
          });
          a.prototype.push = function(e) {
              var h = this.objectPool; - 1 == h.indexOf(e) && (h.push(e), 
              this._length++, 0 == this.frameCount &&
                  (this.frameCount = this.autoDisposeTime, a._callBackList.push(this)))
          };
          a.prototype.pop = function() {
              if (0 == this._length) return null;
              this._length--;
              return this.objectPool.pop()
          };
          a.prototype.dispose = function() {
              0 < this._length && (this.objectPool = [], this._length = 0);
              this.frameCount = 0;
              var e = a._callBackList,
                  h = e.indexOf(this); - 1 != h && e.splice(h, 1)
          };
          a._callBackList = [];
          return a
      }(b.HashObject);
      b.Recycler = d;
      d.prototype.__class__ = "egret.Recycler"
  })(egret);
  (function(b) {
      b.__START_TIME;
      b.getTimer = function() {
          return Date.now() - b.__START_TIME
      }
  })(egret);
  (function(b) {
      b.__callLaterFunctionList = [];
      b.__callLaterThisList = [];
      b.__callLaterArgsList = [];
      b.callLater = function(d, c) {
          for (var a = [], e = 0; e < arguments.length - 2; e++) a[e] = arguments[e + 2];
          b.__callLaterFunctionList.push(d);
          b.__callLaterThisList.push(c);
          b.__callLaterArgsList.push(a)
      }
  })(egret);
  __extends = this.__extends || function(b, d) {
      function c() {
          this.constructor = b
      }
      for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
      c.prototype = d.prototype;
      b.prototype = new c
  };
  (function(b) {
      var d = function(c) {
          function a(e, a, m) {
              "undefined" === typeof a && (a = !1);
              "undefined" === typeof m && (m = !1);
              c.call(this);
              this._eventPhase = 2;
              this._isPropagationImmediateStopped = this._isPropagationStopped = 
              this._isDefaultPrevented = !1;
              this.isNew = !0;
              this._type = e;
              this._bubbles = a;
              this._cancelable = m
          }
          __extends(a, c);
          Object.defineProperty(a.prototype, "type", {
              get: function() {
                  return this._type
              },
              enumerable: !0,
              configurable: !0
          });
          Object.defineProperty(a.prototype, "bubbles", {
              get: function() {
                  return this._bubbles
              },
              enumerable: !0,
              configurable: !0
          });
          Object.defineProperty(a.prototype, "cancelable", {
              get: function() {
                  return this._cancelable
              },
              enumerable: !0,
              configurable: !0
          });
          Object.defineProperty(a.prototype, "eventPhase", {
              get: function() {
                  return this._eventPhase
              },
              enumerable: !0,
              configurable: !0
          });
          Object.defineProperty(a.prototype, "currentTarget", {
              get: function() {
                  return this._currentTarget
              },
              enumerable: !0,
              configurable: !0
          });
          a.prototype._setCurrentTarget = function(e) {
              this._currentTarget = e
          };
          Object.defineProperty(a.prototype, "target", {
              get: function() {
                  return this._target
              },
              enumerable: !0,
              configurable: !0
          });
          a.prototype.isDefaultPrevented = function() {
              return this._isDefaultPrevented
          };
          a.prototype.preventDefault = function() {
              this._cancelable && (this._isDefaultPrevented = !0)
          };
          a.prototype.stopPropagation = function() {
              this._bubbles && (this._isPropagationStopped = !0)
          };
          a.prototype.stopImmediatePropagation = function() {
              this._bubbles && (this._isPropagationImmediateStopped = !0)
          };
          a.prototype._reset = function() {
              this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped =
                  this._isPropagationStopped = this._isDefaultPrevented = !1,
                  this._currentTarget = this._target = null, this._eventPhase = 2)
          };
          a._dispatchByTarget = function(e, a, m, c, d, g) {
              "undefined" === typeof d && (d = !1);
              "undefined" === typeof g && (g = !1);
              var k = e.eventRecycler;
              k || (k = e.eventRecycler = new b.Recycler);
              var n = k.pop();
              n ? n._type = m : n = new e(m);
              n._bubbles = d;
              n._cancelable = g;
              if (c)
                  for (var p in c) n[p] = c[p], null !== n[p] && (c[p] = null);
              e = a.dispatchEvent(n);
              k.push(n);
              return e
          };
          a._getPropertyData = function(e) {
              var a = e._props;
              a || (a = e._props = {});
              return a
          };
          a.dispatchEvent = function(e, h, m, b) {
              "undefined" === typeof m && (m = !1);
              var c = a._getPropertyData(a);
              b && (c.data = b);
              a._dispatchByTarget(a, e, h, c, m)
          };
          a.ADDED_TO_STAGE = "addedToStage";
          a.REMOVED_FROM_STAGE = "removedFromStage";
          a.ADDED = "added";
          a.REMOVED = "removed";
          a.COMPLETE = "complete";
          a.ENTER_FRAME = "enterFrame";
          a.RENDER = "render";
          a.FINISH_RENDER = "finishRender";
          a.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
          a.LEAVE_STAGE = "leaveStage";
          a.RESIZE = "resize";
          a.CHANGE = "change";
          return a
      }(b.HashObject);
      b.Event =
          d;
      d.prototype.__class__ = "egret.Event"
  })(egret);
  __extends = this.__extends || function(b, d) {
      function c() {
          this.constructor = b
      }
      for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
      c.prototype = d.prototype;
      b.prototype = new c
  };
  (function(b) {
      var d = function(c) {
          function a(e, a, m) {
              "undefined" === typeof a && (a = !1);
              "undefined" === typeof m && (m = !1);
              c.call(this, e, a, m)
          }
          __extends(a, c);
          a.dispatchIOErrorEvent = function(e) {
              b.Event._dispatchByTarget(a, e, a.IO_ERROR)
          };
          a.IO_ERROR = "ioError";
          return a
      }(b.Event);
      b.IOErrorEvent = d;
      d.prototype.__class__ = "egret.IOErrorEvent"
  })(egret);
  __extends = this.__extends || function(b, d) {
      function c() {
          this.constructor = b
      }
      for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
      c.prototype = d.prototype;
      b.prototype = new c
  };
  (function(b) {
      var d = function(c) {
          function a(e, a, m, b, d, g, k, n, p, q) {
              "undefined" === typeof a && (a = !0);
              "undefined" === typeof m && (m = !0);
              "undefined" === typeof b && (b = 0);
              "undefined" === typeof d && (d = 0);
              "undefined" === typeof g && (g = 0);
              "undefined" === typeof k && (k = !1);
              "undefined" === typeof n && (n = !1);
              "undefined" === typeof q && (q = !1);
              c.call(this, e, a, m);
              this._localY = this._localX = this._stageY = this._stageX = 0;
              this.touchPointID = b;
              this._stageX = d;
              this._stageY = g;
              this.ctrlKey = k;
              this.altKey = n;
              this.touchDown = q
          }
          __extends(a, c);
          Object.defineProperty(a.prototype,
              "stageX", {
                  get: function() {
                      return this._stageX
                  },
                  enumerable: !0,
                  configurable: !0
              });
          Object.defineProperty(a.prototype, "stageY", {
              get: function() {
                  return this._stageY
              },
              enumerable: !0,
              configurable: !0
          });
          Object.defineProperty(a.prototype, "localX", {
              get: function() {
                  return this._localX
              },
              enumerable: !0,
              configurable: !0
          });
          Object.defineProperty(a.prototype, "localY", {
              get: function() {
                  return this._localY
              },
              enumerable: !0,
              configurable: !0
          });
          a.prototype._setCurrentTarget = function(e) {
              c.prototype._setCurrentTarget.call(this, e);
              e instanceof
                  b.DisplayObject && (e = e.globalToLocal(this._stageX, this._stageY, 
                  b.Point.identity), this._localX = e.x, this._localY = e.y)
          };
          a.dispatchTouchEvent = function(e, h, m, c, d, g, k, n, p) {
              "undefined" === typeof m && (m = 0);
              "undefined" === typeof c && (c = 0);
              "undefined" === typeof d && (d = 0);
              "undefined" === typeof g && (g = !1);
              "undefined" === typeof k && (k = !1);
              "undefined" === typeof n && (n = !1);
              "undefined" === typeof p && (p = !1);
              var q = b.Event._getPropertyData(a);
              q.touchPointID = m;
              q._stageX = c;
              q._stageY = d;
              q.ctrlKey = g;
              q.altKey = k;
              q.shiftKey = n;
              q.touchDown =
                  p;
              b.Event._dispatchByTarget(a, e, h, q, !0, !0)
          };
          a.TOUCH_TAP = "touchTap";
          a.TOUCH_MOVE = "touchMove";
          a.TOUCH_BEGIN = "touchBegin";
          a.TOUCH_END = "touchEnd";
          a.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
          a.TOUCH_ROLL_OUT = "touchRollOut";
          a.TOUCH_ROLL_OVER = "touchRollOver";
          a.TOUCH_OUT = "touchOut";
          a.TOUCH_OVER = "touchOver";
          return a
      }(b.Event);
      b.TouchEvent = d;
      d.prototype.__class__ = "egret.TouchEvent"
  })(egret);
  __extends = this.__extends || function(b, d) {
      function c() {
          this.constructor = b
      }
      for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
      c.prototype = d.prototype;
      b.prototype = new c
  };
  (function(b) {
      var d = function(c) {
          function a(e, a, m) {
              "undefined" === typeof a && (a = !1);
              "undefined" === typeof m && (m = !1);
              c.call(this, e, a, m)
          }
          __extends(a, c);
          a.dispatchTimerEvent = function(e, h) {
              b.Event._dispatchByTarget(a, e, h)
          };
          a.TIMER = "timer";
          a.TIMER_COMPLETE = "timerComplete";
          return a
      }(b.Event);
      b.TimerEvent = d;
      d.prototype.__class__ = "egret.TimerEvent"
  })(egret);

源码

需要源码请关注添加好友哦^ ^

转载:欢迎来到本站,转载请注明文章出处https://ormcc.com/

  • 15
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值