Commit 73b249ae authored by liubing's avatar liubing

增加对方轮次提示音和提示图&修改背景图缩放逻辑。

parent be667906
......@@ -33,6 +33,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.data.waitingWheel && this._audioResList.push({ url: this.data.waitingWheel });
this.data.waitingPiece && this._audioResList.push({ url: this.data.waitingPiece });
this.data.waitingTurn && this._audioResList.push({ url: this.data.waitingTurn });
this.data.otherTurn && this._audioResList.push({ url: this.data.otherTurn });
}
addPreloadAnima() { }
......@@ -118,6 +119,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.initPiece();
this.showAstronautAni();
}
addComponents() {
cc.find('Canvas/bg/chessBoard/boardItems').children.forEach(node => {
let itemData = node.getComponent("space_game_4_item_data");
......@@ -695,7 +697,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
});
}
updateStatus(status = null) {
async updateStatus(status = null) {
if (status) {
console.log("status: " + JSON.stringify(status));
this._status = JSON.parse(JSON.stringify(status));
......@@ -716,6 +718,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.rollPiece(this.getCurrentPiece());
}
} else {
this.audioId = await this.playAudioByUrl(this.data.otherTurn);
this.showOtherTurn();
this.greyDice();
}
......@@ -788,6 +792,23 @@ export default class SceneComponent extends MyCocosSceneComponent {
});
}
// 展示:对方轮次
showOtherTurn() {
return new Promise((resolve, reject) => {
const otherTurn = cc.find("Canvas/bg/otherturn");
otherTurn.active = true;
cc.tween(otherTurn)
.set({ opacity: 0, scale: 5 })
.to(1, { opacity: 255, scale: 2 })
.delay(0.5)
.to(0.5, { opacity: 0 })
.call(() => {
resolve(null);
})
.start();
});
}
async pieceGoBack(node) {
const touchStartPos = node["touchStartPos"];
if (!touchStartPos) {
......
......@@ -9,5 +9,7 @@ export const defaultData = {
"",
waitingTurn:
"",
recordWait: "http://staging-teach.cdn.ireadabc.com/31952573236dd316a8ee1672d1614a1c.mp3"
recordWait: "",
otherTurn: "",
};
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