Commit a0a06131 authored by 范雪寒's avatar 范雪寒

feat: 问题语音

parent 1334df83
...@@ -152,11 +152,8 @@ cc.Class({ ...@@ -152,11 +152,8 @@ cc.Class({
initView() { initView() {
this.refreshCoolCatPosition(); this.refreshCoolCatPosition();
this.coolCatSpeakStart(() => { this.coolCatSpeakStart(() => {
const audioUrl = this.data.question_arr[this.status.currentQuestionIdx].question_audio_url;
this.playAudioByUrl(audioUrl, () => {
this.jumpToQuestion(this.status.currentQuestionIdx); this.jumpToQuestion(this.status.currentQuestionIdx);
}); });
});
}, },
refreshCoolCatPosition() { refreshCoolCatPosition() {
...@@ -167,10 +164,20 @@ cc.Class({ ...@@ -167,10 +164,20 @@ cc.Class({
console.log('canvasWidth = ' + canvasWidth); console.log('canvasWidth = ' + canvasWidth);
console.log('canvasHeight = ' + canvasHeight); console.log('canvasHeight = ' + canvasHeight);
let monster = 100;
let hero = 100;
setInterval(() => {
monster = monster * 1.05;
hero = hero + 5;
console.log(Math.round(monster * 100) / 100);
console.log(Math.round(hero * 100) / 100);
}, 1000);
}, },
jumpToQuestion(questionIdx) { jumpToQuestion(questionIdx) {
const audioUrl = this.data.question_arr[questionIdx].question_audio_url;
this.playAudioByUrl(audioUrl);
const box = cc.find('Canvas/bg/box'); const box = cc.find('Canvas/bg/box');
box.removeAllChildren(); box.removeAllChildren();
......
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