Commit 2309dc1f authored by 李维's avatar 李维

添加点击coolcat播放题目音频

parent 163456fb
{"ver":"1.1.2","uuid":"efac53ec-d7b3-4ce9-aa78-c5e169cfd7c6","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}} {
\ No newline at end of file "ver": "1.1.2",
"uuid": "efac53ec-d7b3-4ce9-aa78-c5e169cfd7c6",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
...@@ -202,6 +202,7 @@ cc.Class({ ...@@ -202,6 +202,7 @@ cc.Class({
}; };
}, },
gameStart: false,
async initView() { async initView() {
const loadingLayerBase = cc.find("Canvas/bg/loadingLayerBase"); const loadingLayerBase = cc.find("Canvas/bg/loadingLayerBase");
const loadingLayerNode = cc.instantiate(this.loadingLayerProfab); const loadingLayerNode = cc.instantiate(this.loadingLayerProfab);
...@@ -212,8 +213,8 @@ cc.Class({ ...@@ -212,8 +213,8 @@ cc.Class({
this.loadingLayer.setMaxPlayerNumber(5); this.loadingLayer.setMaxPlayerNumber(5);
this.loadingLayer.onLoadFinished(() => { this.loadingLayer.onLoadFinished(() => {
this.gameStart = true;
this.refreshCoolCatPosition(); this.refreshCoolCatPosition();
this.coolCatSpeakStart(() => { this.coolCatSpeakStart(() => {
this.startCountTime(); this.startCountTime();
this.jumpToQuestion(this.status.currentQuestionIdx); this.jumpToQuestion(this.status.currentQuestionIdx);
...@@ -397,6 +398,15 @@ cc.Class({ ...@@ -397,6 +398,15 @@ cc.Class({
this.optionJump(btnNext, 0.05); this.optionJump(btnNext, 0.05);
}); });
const coolCat = cc.find("Canvas/bg/catFrame/clickTarget");
coolCat.on("click", () => {
if(this.gameStart) {
const questionAudioUrl = this.data.question_arr[this.status.currentQuestionIdx].audio_url;
console.log("Click coolcat:", questionAudioUrl)
this.coolCatSpeak(questionAudioUrl)
}
});
this.initNetworkListener(); this.initNetworkListener();
}, },
......
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