Commit 56d1898b authored by 杨一航's avatar 杨一航

add

parent 00875b70
......@@ -112,4 +112,9 @@ export default class Keyboard extends cc.Component {
this.btnHideNode.active = false;
}
}
showTips() {
cc.tween(this.btnShowNode).to(0.3, { scale: 1.2 }).to(0.7, { scale: 1 }).start();
cc.tween(this.btnHideNode).to(0.3, { scale: 1.2 }).to(0.7, { scale: 1 }).start();
}
}
......@@ -68,6 +68,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
_wordData: any;
private _otherWord: any;
private _isRecording: any;
private _guessWords: any;
onLoad() {
......@@ -94,13 +95,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
_reqestWord() {
if (!this._inputWords) {
if (!this._guessWords) {
return;
}
this._sendMsg(MsgType.USER_REQ_WOED, { word: this._inputWords, uuid: this.playerId })
this._sendMsg(MsgType.USER_REQ_WOED, { word: this._guessWords, uuid: this.playerId })
}
_inputWords(word) {
this._inputWords = word;
this._guessWords = word;
this.inputNode.getChildByName("lb").getComponent(cc.Label).string = word;
}
......@@ -187,6 +188,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
if (this._catSpeaking) {
return;
}
if (this._isRecording) {
return
}
this._catSpeaking = true;
this.catAni();
})
......@@ -254,6 +258,25 @@ export default class SceneComponent extends MyCocosSceneComponent {
asyncPlayDragonBoneAnimation(this.cat, "normal", 0);
this._catSpeaking = false;
})
if (index == 0) {
asyncDelay(1).then(() => {
this._keyboard.showTips();
})
} else if (index == 1) {
asyncDelay(1).then(() => {
cc.tween(this.pp).to(0.3, { scale: 1.2 }).to(0.7, { scale: 1 }).start();
})
} else {
asyncDelay(1.5).then(() => {
cc.tween(this.pp).to(0.3, { scale: 1.2 }).to(0.7, { scale: 1 }).start();
})
}
}
playerId;
......@@ -566,9 +589,19 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.playAudioByUrl(this.data.audioUrl_waiting_firstRound, () => {
asyncPlayDragonBoneAnimation(this.cat, "normal", 0)
this._catSpeaking = false;
let card = this.cardRoot.children[index];
let cardNode: cc.Node = card.getChildByName("card");
let pos = this.myCardRoot.convertToNodeSpaceAR(cardNode.convertToWorldSpaceAR(cc.v2(0, 0)))
this.myCardRoot.getChildByName("card").getComponent(cc.Sprite).spriteFrame = this.cardList[index]
let myCard = this.myCardRoot.getChildByName("card");
let pos1 = myCard.position;
myCard.x = pos.x;
myCard.y = pos.y;
cc.tween(myCard).to(1, { x: pos1.x, y: pos1.y }).call(() => {
this.myCardRoot.getChildByName("word").getComponent(cc.Label).string = word;
resolve("");
}).start();
})
})
......@@ -637,6 +670,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
this._canChosendCard = false;
this.playLocalAudio("btn")
let cards = this.cardRoot.children;
for (let i = 0; i < this.cardList.length; ++i) {
......@@ -652,8 +686,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
word: word,
}
)
let cardNode: cc.Node = card.getChildByName("card");
let pos = this.myCardRoot.convertToNodeSpaceAR(cardNode.convertToWorldSpaceAR(cc.v2(0, 0)))
this.myCardRoot.getChildByName("card").getComponent(cc.Sprite).spriteFrame = this.cardList[index]
let myCard = this.myCardRoot.getChildByName("card");
let pos1 = myCard.position;
myCard.x = pos.x;
myCard.y = pos.y;
cc.tween(myCard).to(1, { x: pos1.x, y: pos1.y }).call(() => {
this.myCardRoot.getChildByName("word").getComponent(cc.Label).string = word;
}).start();
})
......
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