Commit 29f6bbcc authored by Master Q's avatar Master Q

init

parent 999fd2d6
...@@ -377,5 +377,5 @@ export const ResJson = { ...@@ -377,5 +377,5 @@ export const ResJson = {
} }
], ],
// eslint-disable-next-line // eslint-disable-next-line
"path": "https://yun.duiba.com.cn/db_games/activity/template/1646963505/resource/" "path": "https://yun.duiba.com.cn/db_games/activity/template/1647225387/resource/"
} }
\ No newline at end of file
...@@ -49,6 +49,13 @@ class CountDownBoard extends FYGE.Container { ...@@ -49,6 +49,13 @@ class CountDownBoard extends FYGE.Container {
// this._countDownText = UI.Txt(this, this._initCountDownNum + '', 30, '#fff', FYGE.TEXT_ALIGN.RIGHT, 200, 200, 30) // this._countDownText = UI.Txt(this, this._initCountDownNum + '', 30, '#fff', FYGE.TEXT_ALIGN.RIGHT, 200, 200, 30)
} }
/**
* 初始化 倒计时
*/
initCountDownNum() {
this._countDownText.text = this._initCountDownNum + ''
}
public restart() { public restart() {
this.stopCountDown() this.stopCountDown()
this.countDown = this._initCountDownNum this.countDown = this._initCountDownNum
...@@ -501,6 +508,7 @@ export default class IndexScene extends Scene { ...@@ -501,6 +508,7 @@ export default class IndexScene extends Scene {
this.musicStatus = Tools.PAGE.musicStatus this.musicStatus = Tools.PAGE.musicStatus
this.recoverGameEles() this.recoverGameEles()
this.onInitGamer() this.onInitGamer()
this.CountDownCont.initCountDownNum()
} }
/** /**
...@@ -519,12 +527,14 @@ export default class IndexScene extends Scene { ...@@ -519,12 +527,14 @@ export default class IndexScene extends Scene {
/** /**
* 游戏结束 * 游戏结束
*/ */
onGameOver() { onGameOver(isDelay: boolean = false) {
this.GameStatus = 0 this.GameStatus = 0
this.CountDownCont.stopCountDown() this.CountDownCont.stopCountDown()
GDispatcher.dispatchEvent(GameEvent.GAME_OVER, { setTimeout(() => {
score: this.score GDispatcher.dispatchEvent(GameEvent.GAME_OVER, {
}) score: this.score
})
}, isDelay ? 500 : 0)
} }
/** /**
...@@ -546,9 +556,9 @@ export default class IndexScene extends Scene { ...@@ -546,9 +556,9 @@ export default class IndexScene extends Scene {
const curr = this.currGameEleResource const curr = this.currGameEleResource
const currResource: GameEleResource = curr.resource const currResource: GameEleResource = curr.resource
const currGameELe = GPool.takeOut<GameEleSprit>(currResource) || this.addChild(new GameEleSprit(currResource, curr.score)) const currGameELe = GPool.takeOut<GameEleSprit>(currResource) || this.addChild(new GameEleSprit(currResource, curr.score))
currGameELe.position.set(randomNum(this.axisX[0], this.axisX[1]), layers.stageOffsetY-100)
currGameELe.visible = true currGameELe.visible = true
this.gameElesList.push(currGameELe) this.gameElesList.push(currGameELe)
currGameELe.position.set(randomNum(this.axisX[0], this.axisX[1]), layers.stageOffsetY)
if (!currGameELe.pythicCont) { if (!currGameELe.pythicCont) {
const debug = false const debug = false
if (currResource === 'bellSprit.png') { if (currResource === 'bellSprit.png') {
...@@ -662,7 +672,7 @@ export default class IndexScene extends Scene { ...@@ -662,7 +672,7 @@ export default class IndexScene extends Scene {
// console.log(item) // console.log(item)
if (item.score == 0) { if (item.score == 0) {
console.log('boom', item) console.log('boom', item)
this.onGameOver() this.onGameOver(true)
} }
this.score += item.score this.score += item.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