Commit 78d981b1 authored by 杨一航's avatar 杨一航

fix

parent 8be0844f
...@@ -30,6 +30,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -30,6 +30,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
private _redOriginPos: any; private _redOriginPos: any;
private _blueOriginPos: any; private _blueOriginPos: any;
private _playingAudio: boolean; private _playingAudio: boolean;
private _canClick: any;
addPreloadImage() { addPreloadImage() {
...@@ -239,7 +240,8 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -239,7 +240,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
bgNode.scale = this._mapScaleMax; bgNode.scale = this._mapScaleMax;
const cover = cc.find("Canvas/cover") const cover = cc.find("Canvas/cover")
cover.scale = this._mapScaleMax; cover.width = cc.winSize.width;
cover.height = cc.winSize.height;
const endRoot = cc.find("Canvas/endRoot") const endRoot = cc.find("Canvas/endRoot")
endRoot.scale = this._mapScaleMax; endRoot.scale = this._mapScaleMax;
...@@ -306,8 +308,10 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -306,8 +308,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
case 0: case 0:
if (this.isMySide) { if (this.isMySide) {
this.normaltheDice(); this.normaltheDice();
this._canClick = false;
await this.showYourTurn(); await this.showYourTurn();
this.blinkTheDice(); this.blinkTheDice();
this._canClick = true;
} else { } else {
this.greyDice(); this.greyDice();
} }
...@@ -393,7 +397,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -393,7 +397,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
initListener() { initListener() {
this.boardBtn.on("click", () => { this.boardBtn.on("click", () => {
if (!this.isMySide || this._status.state != 0) { if (!this.isMySide || this._status.state != 0 || !this._canClick) {
return; return;
} }
this.playLocalAudio("btn"); this.playLocalAudio("btn");
......
...@@ -105,17 +105,17 @@ export class MyCocosSceneComponent extends cc.Component { ...@@ -105,17 +105,17 @@ export class MyCocosSceneComponent extends cc.Component {
}); });
} }
log (str) { log(str) {
const node = cc.find('middleLayer'); const node = cc.find('middleLayer');
if(node){ if (node) {
node.getComponent('middleLayer').log(str); node.getComponent('middleLayer').log(str);
}else{ } else {
cc.log(str); cc.log(str);
} }
} }
onLoadEnd() { onLoadEnd() {
} }
...@@ -132,7 +132,7 @@ export class MyCocosSceneComponent extends cc.Component { ...@@ -132,7 +132,7 @@ export class MyCocosSceneComponent extends cc.Component {
// ------------------------------------------------ // ------------------------------------------------
getSprNode(resName) { getSprNode(resName) {
const sf = cc.find('Canvas/res/img/' + resName).getComponent(cc.Sprite).spriteFrame; const sf = cc.find('Canvas/res/img/' + resName).getComponent(cc.Sprite).spriteFrame;
...@@ -172,7 +172,7 @@ export class MyCocosSceneComponent extends cc.Component { ...@@ -172,7 +172,7 @@ export class MyCocosSceneComponent extends cc.Component {
}); });
} }
}); });
}else{ } else {
cb && cb(); cb && cb();
} }
} }
......
export const defaultData = { export const defaultData = {
"gameStartAudio":
"http://staging-teach.cdn.ireadabc.com/7c18e0838dcf0707f885842ed09e1579.mp3",
"gameLoadingAudio":
"http://staging-teach.cdn.ireadabc.com/6b3846cee6afa2ae450234aeec835beb.mp3",
"waitingWheel":
"http://staging-teach.cdn.ireadabc.com/23376490a9ba0f4a3fe0618fc1c935e1.mp3",
"waitingPiece":
"http://staging-teach.cdn.ireadabc.com/b44fa51172b19b555fda30717c773027.mp3",
"waitingTurn":
"http://staging-teach.cdn.ireadabc.com/a6a5c388c636bc6d063946e91b4bd21a.mp3",
}; };
\ No newline at end of file
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