Commit b525a596 authored by Master Q's avatar Master Q

开始游戏逻辑调整

parent 88dfd6e5
{
"success": true
}
\ No newline at end of file
......@@ -14,6 +14,6 @@
"rewardCredits": 10
}
],
"skiingGuideFlag": 1
"skiingGuideFlag": 0
}
}
\ No newline at end of file
......@@ -656,5 +656,5 @@ export const ResJson = {
"name": "svga"
}
],
"path": "https://yun.duiba.com.cn/db_games/activity/template/1639627848/resource/"
"path": "https://yun.duiba.com.cn/db_games/activity/template/1639994156/resource/"
}
\ No newline at end of file
......@@ -118,7 +118,8 @@ export enum TbNetName {
showRuleModal = 'mine.showRuleModal',
back = 'mine.back',
indexSceneVisible="mine.indexSceneVisible",
turnBgm = 'mine.turnBgm'
turnBgm = 'mine.turnBgm',
checkGameNum = 'snow.checkGameNum'
}
export enum TBBgm {
......
......@@ -276,6 +276,11 @@ export class GameScene extends Scene {
await sendTbNet(TbNetName.doModifySkiingGuideFlag, {
flag: 1
})
const { success, data } = await sendTbNet(TbNetName.doStart)
if (!success) {
changeScene(IndexScene)
return
}
this.RabbitCont.visible = true
this.onStart()
}))
......
import { showToast } from './../../module/ctrls/toastCtrl';
import { changeScene } from './../../module/ctrls/index';
import { layers } from './../../module/views/layers';
import { Scene } from "../../module/views/Scene";
......@@ -73,15 +74,25 @@ export default class IndexScene extends Scene {
}
async onGameStart() {
const { success, data } = await sendTbNet(TbNetName.doStart)
if (success) {
sendTbNet(TbNetName.indexSceneVisible, {visible: false})
const {success: s} = await sendTbNet(TbNetName.checkGameNum)
if (!s) {
showToast('游戏次数不足')
return
}
sendTbNet(TbNetName.indexSceneVisible, {visible: false})
if ( this.indexSceneData.skiingGuideFlag == 0 ) {
changeScene(GameScene, {
isNewGuy: !this.indexSceneData.skiingGuideFlag,
haveRadish: data.haveRadish
isNewGuy: true
})
} else {
const { success, data } = await sendTbNet(TbNetName.doStart)
if (success) {
changeScene(GameScene, {
isNewGuy: false,
haveRadish: data.haveRadish
})
}
}
}
onRuleShowPanel() {
......
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