Commit a6011d93 authored by AU-Pro-mac's avatar AU-Pro-mac

fixed game bugs

parent 45bb3d75
......@@ -2971,7 +2971,7 @@ var GoodsContainer = (function (_super) {
_this.goodsArr = [];
_this.createGoodTimeOut = false;
_this.intoGoods = [];
_this.gameEndFlag = false;
_this.gameEndFlag = 0;
_this.speed = 2.5;
_this.acceleratedSpeed = 0.01;
_this.lt = 0;
......@@ -3060,7 +3060,13 @@ var GoodsContainer = (function (_super) {
g.turnDirection(direction);
if (g.dir !== direction) {
if (g.wrong === 'endGame') {
g.turnDirection(direction, 'gameOver');
this.gameEndFlag += 1;
if (this.gameEndFlag > 1) {
g.turnDirection(direction);
}
else {
g.turnDirection(direction, 'gameOver');
}
}
else {
this._root.gameScoreChange(g.wrong);
......@@ -3112,7 +3118,7 @@ var GoodsContainer = (function (_super) {
this.goodsContainer = null;
};
GoodsContainer.prototype.startGoods = function () {
this.gameEndFlag = false;
this.gameEndFlag = 0;
this.createGoodTimeOut = true;
};
GoodsContainer.prototype.createGoods = function () {
......@@ -3158,9 +3164,6 @@ var GoodsContainer = (function (_super) {
}, 750)
.call(function () {
if (cb === 'gameOver') {
if (_this.gameEndFlag)
return;
_this.gameEndFlag = true;
_this.removeAllGoods();
_this._root.gameOver();
}
......@@ -3182,9 +3185,6 @@ var GoodsContainer = (function (_super) {
}, 750)
.call(function () {
if (cb === 'gameOver') {
if (_this.gameEndFlag)
return;
_this.gameEndFlag = true;
_this.removeAllGoods();
_this._root.gameOver();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment