Commit 6d083fc9 authored by huangwenjie's avatar huangwenjie

1

parent 5fd30067
...@@ -602,6 +602,10 @@ export class PlayScene extends Scene { ...@@ -602,6 +602,10 @@ export class PlayScene extends Scene {
this.bombBtn.mouseEnable = true this.bombBtn.mouseEnable = true
this.bombing = false this.bombing = false
this.removeChild(showImage) this.removeChild(showImage)
if (this.checkAllZero()) {
// 只有0
this.generateOneElement()
}
}, 300); }, 300);
}, PropType.boom) }, PropType.boom)
...@@ -703,6 +707,10 @@ export class PlayScene extends Scene { ...@@ -703,6 +707,10 @@ export class PlayScene extends Scene {
this.removeAnis() this.removeAnis()
// if (!this.isGameWin()) // if (!this.isGameWin())
this.isGameOver() this.isGameOver()
if (this.checkAllZero()) {
// 只有0
this.generateOneElement()
}
}, 300); }, 300);
}, PropType.net) }, PropType.net)
}, this) }, this)
...@@ -934,7 +942,7 @@ export class PlayScene extends Scene { ...@@ -934,7 +942,7 @@ export class PlayScene extends Scene {
// 随机生成基础元素 // 随机生成基础元素
generateOneElement() { generateOneElement() {
// 随机生成一个数字 2or4 // 随机生成一个数字 2or4
let randNumber = Math.random() < 0.5 ? 2 : 2048 let randNumber = Math.random() < 0.9 ? 2 : 4
// 随机生成位置 // 随机生成位置
let randNumberX = Math.floor(Math.random() * 4) let randNumberX = Math.floor(Math.random() * 4)
let randNumberY = Math.floor(Math.random() * 4) let randNumberY = Math.floor(Math.random() * 4)
......
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