Commit 873ba418 authored by 范雪寒's avatar 范雪寒

feat: 结尾 音频

parent 5fd800fc
...@@ -166,6 +166,7 @@ cc.Class({ ...@@ -166,6 +166,7 @@ cc.Class({
.start(); .start();
}, },
coolCatAlreadySpeakEnd: null,
async createItem(itemData, bg) { async createItem(itemData, bg) {
const bgScale = bg.width / this.data.bgItem.rect.width; const bgScale = bg.width / this.data.bgItem.rect.width;
...@@ -176,11 +177,14 @@ cc.Class({ ...@@ -176,11 +177,14 @@ cc.Class({
item.clicked = true; item.clicked = true;
this.shakeItem(item); this.shakeItem(item);
await this.asyncPlayAudioByUrl(itemData.audio_url); await this.asyncPlayAudioByUrl(itemData.audio_url);
if (!this.coolCatAlreadySpeakEnd) {
if (this.itemList.every(tmpItem => tmpItem.clicked)) { if (this.itemList.every(tmpItem => tmpItem.clicked)) {
this.coolCatAlreadySpeakEnd = true;
await asyncDelay(0.3); await asyncDelay(0.3);
await this.coolCatSpeakEnd(); await this.coolCatSpeakEnd();
onHomeworkFinish(); onHomeworkFinish();
} }
}
}); });
await this.asyncLoadSpriteByUrl(item, itemData.pic_url); await this.asyncLoadSpriteByUrl(item, itemData.pic_url);
......
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