Commit 1a9c1083 authored by 杨一航's avatar 杨一航

add

parent 4a43c9da
...@@ -37,8 +37,8 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -37,8 +37,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
myCardRoot = null myCardRoot = null
@property(cc.Node) @property(cc.Node)
inputNode = null inputNode = null
@property(cc.Label) @property(cc.Node)
lb_youSay = null recordNode = null
@property(cc.SpriteFrame) @property(cc.SpriteFrame)
cardList = [] cardList = []
...@@ -200,6 +200,8 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -200,6 +200,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.inputNode.on("click", this._reqestWord, this); this.inputNode.on("click", this._reqestWord, this);
this.pp.active = false; this.pp.active = false;
this.recordNode.scaleY = 0;
this.recordNode.scalex = 1;
this.btn_record.active = false; this.btn_record.active = false;
this.btn_record.on("click", this.openCoursView, this); this.btn_record.on("click", this.openCoursView, this);
...@@ -532,7 +534,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -532,7 +534,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this._sendMsg(MsgType.USER_PREPARE_REQ, {}); this._sendMsg(MsgType.USER_PREPARE_REQ, {});
this._keyboard.showOut(); this._keyboard.showOut();
this.inputNode.active = true; this.inputNode.active = true;
this.btn_record.active = true; // this.btn_record.active = true;
} }
this._clockTime.string = "0"; this._clockTime.string = "0";
...@@ -559,6 +561,14 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -559,6 +561,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
this._catSpeaking = true; this._catSpeaking = true;
asyncDelay(3).then(() => { asyncDelay(3).then(() => {
this.pp.active = true; this.pp.active = true;
this.pp.scale = 0;
cc.tween(this.pp).to(1, { scale: 1 }, { easing: "backOut" }).start();
this.btn_record.active = true;
this.btn_record.y = -cc.winSize.height / 2;
cc.tween(this.btn_record).to(1, { y: this.btn_record.height - cc.winSize.height / 2 }).start();
}) })
this.playAudioByUrl(this.data.audioUrl_filled, () => { this.playAudioByUrl(this.data.audioUrl_filled, () => {
...@@ -801,7 +811,10 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -801,7 +811,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
if (this._isRecording) return; if (this._isRecording) return;
this._isRecording = true this._isRecording = true
this.btn_record.getChildByName("lb").getComponent(cc.Label).string = "录音中。。。"; this.btn_record.getChildByName("cover").active = true;
this.recordNode.scalex = 1;
cc.tween(this.recordNode).to(0.3, { scaleX: 0 }, { easing: "sinOut" }).start();
cc.audioEngine.stopAllEffects(); cc.audioEngine.stopAllEffects();
this.unschedule(this.longTimeNoAction) this.unschedule(this.longTimeNoAction)
...@@ -837,14 +850,20 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -837,14 +850,20 @@ export default class SceneComponent extends MyCocosSceneComponent {
this._startCourseware(); this._startCourseware();
await asyncDelay(0.5); await asyncDelay(0.5);
// 6s // 6s
probar.getComponent(cc.ProgressBar).schedule(() => { // probar.getComponent(cc.ProgressBar).schedule(() => {
probar.getComponent(cc.ProgressBar).progress = total; // probar.getComponent(cc.ProgressBar).progress = total;
total -= 1 / 30; // total -= 1 / 20;
if (total < 0) { // if (total < 0) {
probar.getComponent(cc.ProgressBar).unscheduleAllCallbacks(); // probar.getComponent(cc.ProgressBar).unscheduleAllCallbacks();
this._coursewareStoped(); // this._coursewareStoped();
} // }
}, 0.1, 61, 0.1) // }, 0.1, 41, 0.1)
asyncPlayDragonBoneAnimation(this.cat, "record", 0)
this.scheduleOnce(() => {
this._coursewareStoped();
asyncPlayDragonBoneAnimation(this.cat, "normal", 0)
}, 3.5)
} }
async _startCourseware() { async _startCourseware() {
...@@ -876,7 +895,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -876,7 +895,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this._coursewareEnd(res.text) this._coursewareEnd(res.text)
}); });
} else { } else {
await asyncDelay(3); // await asyncDelay(3);
this.log("web 模拟录音评测 结果"); this.log("web 模拟录音评测 结果");
this._coursewareEnd("test") this._coursewareEnd("test")
} }
...@@ -885,14 +904,17 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -885,14 +904,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
async _coursewareEnd(text: string) { async _coursewareEnd(text: string) {
this._isRecording = false; this._isRecording = false;
this.btn_record.getChildByName("lb").getComponent(cc.Label).string = "点击向我提问"; this.btn_record.getChildByName("cover").active = false;
this.cover.active = false; this.cover.active = false;
let strs: Array<string> = this._wordData[this._otherWord]; let strs: Array<string> = this._wordData[this._otherWord];
console.log("匹配问题?") console.log("匹配问题?")
console.log(strs) console.log(strs)
this.lb_youSay.string = "You said:" + text; this.recordNode.getChildByName("lb").getComponent(cc.Label).string = "" + text;
this.recordNode.scaleX = 1;
this.recordNode.scaleY = 0;
cc.tween(this.recordNode).to(1, { scaleY: 1 }, { easing: "sineOut" }).start();
if (strs.indexOf(text) > -1) { if (strs.indexOf(text) > -1) {
this.playLocalAudio("right") this.playLocalAudio("right")
} else { } else {
......
...@@ -177,6 +177,13 @@ export class GameServer { ...@@ -177,6 +177,13 @@ export class GameServer {
} else { } else {
clearInterval(this._timer) clearInterval(this._timer)
this._gameData.Time = 0;
this._senMsg({
type: MsgType.ROOM_ST,
data: this._gameData.Msg
});
this._senMsg({ this._senMsg({
type: MsgType.ROUND_END_EV, type: MsgType.ROUND_END_EV,
data: { round: 2, uuid: "none", isWin: false, list: this._gameData.getAnswerList() } data: { round: 2, uuid: "none", isWin: false, list: this._gameData.getAnswerList() }
......
{
"ver": "2.3.5",
"uuid": "2ab7120a-c8ce-49f4-82a3-18259362410a",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 244,
"height": 232,
"platformSettings": {},
"subMetas": {
"bg_clicktorecord": {
"ver": "1.0.4",
"uuid": "c0e8c208-d7bc-404e-84e9-a2b66db40818",
"rawTextureUuid": "2ab7120a-c8ce-49f4-82a3-18259362410a",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -0.5,
"trimX": 1,
"trimY": 1,
"width": 242,
"height": 231,
"rawWidth": 244,
"rawHeight": 232,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "2fa2d35c-69d6-46ab-b6bf-e8ab9f1b938c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1122,
"height": 142,
"platformSettings": {},
"subMetas": {
"bg_record_text": {
"ver": "1.0.4",
"uuid": "a0a8ab7c-f97a-4f7d-b675-0ba1f65909d0",
"rawTextureUuid": "2fa2d35c-69d6-46ab-b6bf-e8ab9f1b938c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1122,
"height": 142,
"rawWidth": 1122,
"rawHeight": 142,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "4f0729a3-5c73-4e8f-96fa-d59666649364",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2133,
"height": 355,
"platformSettings": {},
"subMetas": {
"blue_bg": {
"ver": "1.0.4",
"uuid": "71c6b9db-5370-46e6-9bb3-672311708783",
"rawTextureUuid": "4f0729a3-5c73-4e8f-96fa-d59666649364",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 2133,
"height": 355,
"rawWidth": 2133,
"rawHeight": 355,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "a7d21d0e-3e9c-4d74-901e-e1dff94f6418",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2133,
"height": 289,
"platformSettings": {},
"subMetas": {
"bottom": {
"ver": "1.0.4",
"uuid": "ca045e37-118e-452e-a069-0c1c8a4ff4dd",
"rawTextureUuid": "a7d21d0e-3e9c-4d74-901e-e1dff94f6418",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 2133,
"height": 289,
"rawWidth": 2133,
"rawHeight": 289,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "06b16828-976a-464c-9643-8d3fe54b0aec",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 244,
"height": 232,
"platformSettings": {},
"subMetas": {
"btn_recording": {
"ver": "1.0.4",
"uuid": "e673c3e4-d996-46a3-86cf-c514177531dd",
"rawTextureUuid": "06b16828-976a-464c-9643-8d3fe54b0aec",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -0.5,
"trimX": 1,
"trimY": 1,
"width": 242,
"height": 231,
"rawWidth": 244,
"rawHeight": 232,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "93c70056-3270-49cc-a141-adae1ae959ec",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 566,
"height": 435,
"platformSettings": {},
"subMetas": {
"img_questions": {
"ver": "1.0.4",
"uuid": "7d2d3c26-3555-4d02-be0d-03f651aa2b2f",
"rawTextureUuid": "93c70056-3270-49cc-a141-adae1ae959ec",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 566,
"height": 435,
"rawWidth": 566,
"rawHeight": 435,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "2.3.5",
"uuid": "4a3edcbb-935b-4859-9339-508200677a18",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2133,
"height": 955,
"platformSettings": {},
"subMetas": {
"middle_bg": {
"ver": "1.0.4",
"uuid": "0d004320-3fbb-4e1b-81d5-667db289d101",
"rawTextureUuid": "4a3edcbb-935b-4859-9339-508200677a18",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 2133,
"height": 955,
"rawWidth": 2133,
"rawHeight": 955,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ 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