Commit bdd543d4 authored by huangwenjie's avatar huangwenjie

1

parent 82a944d8
import { PropPanel } from './../../panels/PropPanel';
import { QuitPanel } from './../../panels/QuitPanel'; import { QuitPanel } from './../../panels/QuitPanel';
import { PropOutPanel } from './../../panels/PropOutPanel'; import { PropOutPanel } from './../../panels/PropOutPanel';
import { showWaiting, hideWaiting } from './../../../module/ctrls/waitingCtrl'; import { showWaiting, hideWaiting } from './../../../module/ctrls/waitingCtrl';
...@@ -452,8 +453,8 @@ export class PlayScene extends Scene { ...@@ -452,8 +453,8 @@ export class PlayScene extends Scene {
getTools() getTools()
if (!this.isGameWin()) // if (!this.isGameWin())
this.isGameOver() this.isGameOver()
}, PropType.exchange) }, PropType.exchange)
} else if (this.exchangeTargetPool.length = 1) { } else if (this.exchangeTargetPool.length = 1) {
for (let x = 0; x < 4; x++) { for (let x = 0; x < 4; x++) {
...@@ -685,8 +686,8 @@ export class PlayScene extends Scene { ...@@ -685,8 +686,8 @@ export class PlayScene extends Scene {
this.removeChild(this.doFilterBtn) this.removeChild(this.doFilterBtn)
this.filtering = false this.filtering = false
this.removeAnis() this.removeAnis()
if (!this.isGameWin()) // if (!this.isGameWin())
this.isGameOver() this.isGameOver()
}, 300); }, 300);
}, PropType.net) }, PropType.net)
}, this) }, this)
...@@ -817,8 +818,8 @@ export class PlayScene extends Scene { ...@@ -817,8 +818,8 @@ export class PlayScene extends Scene {
await this.moveAni(beforeArr) await this.moveAni(beforeArr)
this.renderBoard() this.renderBoard()
this.generateOneElement() this.generateOneElement()
if (!this.isGameWin()) // if (!this.isGameWin())
this.isGameOver() this.isGameOver()
} }
} }
if (this.offsetX < 0) { if (this.offsetX < 0) {
...@@ -828,8 +829,8 @@ export class PlayScene extends Scene { ...@@ -828,8 +829,8 @@ export class PlayScene extends Scene {
await this.moveAni(beforeArr) await this.moveAni(beforeArr)
this.renderBoard() this.renderBoard()
this.generateOneElement() this.generateOneElement()
if (!this.isGameWin()) // if (!this.isGameWin())
this.isGameOver() this.isGameOver()
} }
} }
} else { } else {
...@@ -841,8 +842,8 @@ export class PlayScene extends Scene { ...@@ -841,8 +842,8 @@ export class PlayScene extends Scene {
await this.moveAni(beforeArr) await this.moveAni(beforeArr)
this.renderBoard() this.renderBoard()
this.generateOneElement() this.generateOneElement()
if (!this.isGameWin()) // if (!this.isGameWin())
this.isGameOver() this.isGameOver()
} }
} }
if (this.offsetY < 0) { if (this.offsetY < 0) {
...@@ -852,8 +853,8 @@ export class PlayScene extends Scene { ...@@ -852,8 +853,8 @@ export class PlayScene extends Scene {
await this.moveAni(beforeArr) await this.moveAni(beforeArr)
this.renderBoard() this.renderBoard()
this.generateOneElement() this.generateOneElement()
if (!this.isGameWin()) // if (!this.isGameWin())
this.isGameOver() this.isGameOver()
} }
} }
} }
...@@ -989,7 +990,7 @@ export class PlayScene extends Scene { ...@@ -989,7 +990,7 @@ export class PlayScene extends Scene {
gameover() { gameover() {
// 游戏结束 // 游戏结束
console.log("游戏结束"); console.log("游戏结束");
showPanel(PropPanel)
} }
isGameWin() { isGameWin() {
...@@ -1166,7 +1167,7 @@ export class PlayScene extends Scene { ...@@ -1166,7 +1167,7 @@ export class PlayScene extends Scene {
let addScore = 0 let addScore = 0
for (let i = 1; i < arr.length; i++) { for (let i = 1; i < arr.length; i++) {
if (arr[i] === 0) break if (arr[i] === 0) break
if (arr[i] === arr[i - 1]) { if (arr[i] === arr[i - 1] && arr[i - 1] < 2048) {
// fromIdx 要改成转换前的idx // fromIdx 要改成转换前的idx
// this.moveData[t].push({ "fromValue": arr[i - 1], "toValue": arr[i - 1] * 2, "fromIdx": i, "toIdx": i - 1 }) // this.moveData[t].push({ "fromValue": arr[i - 1], "toValue": arr[i - 1] * 2, "fromIdx": i, "toIdx": i - 1 })
......
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