Commit 0e112860 authored by Friends233's avatar Friends233

事件处理

parent 9074f559
This diff is collapsed.
......@@ -36,9 +36,9 @@ export default class GameScene extends cc.Component {
this.blockMatrix = cc.find('blockMatrix', this.node)
const { maxRow, maxCol } = this.gameConfig
const testBlock = []
for (let i = 0; i < maxCol - 2; i++) {
testBlock.push(...Array(6).fill('').map((_, j) => j + 1 + (i + 1) * maxRow))
}
// for (let i = 0; i < maxCol - 2; i++) {
// testBlock.push(...Array(6).fill('').map((_, j) => j + 1 + (i + 1) * maxRow))
// }
this.setDefaultBlock(testBlock)
this.addNodeEvent()
}
......@@ -145,8 +145,11 @@ export default class GameScene extends cc.Component {
...Config,
...con
}
this.score = 0
this.setBlockNum = 0
this.setLable('score', 0)
this.setLable('bestScore', '历史最高分:' + (con.bestScore || 0))
this.setLable('goldCoin', (con.goldCoin || 0) + '')
this.setDefaultBlock()
}
......@@ -154,7 +157,9 @@ export default class GameScene extends cc.Component {
/** 游戏结束 */
gameOver() {
this.isGameOver = true
console.log('gameOver')
exportEvent.fire(CUSTOM_EVENT.GAME_OVER, {
score:this.score
})
}
......
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