Commit 6d083fc9 authored by huangwenjie's avatar huangwenjie

1

parent 5fd30067
......@@ -602,6 +602,10 @@ export class PlayScene extends Scene {
this.bombBtn.mouseEnable = true
this.bombing = false
this.removeChild(showImage)
if (this.checkAllZero()) {
// 只有0
this.generateOneElement()
}
}, 300);
}, PropType.boom)
......@@ -703,6 +707,10 @@ export class PlayScene extends Scene {
this.removeAnis()
// if (!this.isGameWin())
this.isGameOver()
if (this.checkAllZero()) {
// 只有0
this.generateOneElement()
}
}, 300);
}, PropType.net)
}, this)
......@@ -934,7 +942,7 @@ export class PlayScene extends Scene {
// 随机生成基础元素
generateOneElement() {
// 随机生成一个数字 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 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