Commit 2b884faf authored by 范雪寒's avatar 范雪寒

feat:

parent 4c33145c
{
"ver": "1.0.1",
"uuid": "472cce5e-32ce-4cf6-afcd-10a6afdcf0f7",
"subMetas": {}
}
\ No newline at end of file
{"width":512,"imagePath":"猫咪躺在木板_tex.png","height":1024,"name":"猫咪躺在木板","SubTexture":[{"width":497,"y":1,"height":113,"name":"猫咪躺在木板(1)(1)/木板","x":1},{"width":62,"y":465,"height":146,"name":"猫咪躺在木板(1)(1)/尾巴","x":388},{"width":112,"y":465,"height":80,"name":"猫咪躺在木板(1)(1)/右腿","x":147},{"width":126,"y":547,"height":67,"name":"猫咪躺在木板(1)(1)/左腿_","x":147},{"width":120,"y":502,"height":42,"name":"猫咪躺在木板(1)(1)/右手","x":1},{"width":149,"y":116,"height":121,"name":"猫咪躺在木板(1)(1)/身体","x":267},{"width":264,"y":116,"height":207,"name":"猫咪躺在木板(1)(1)/头","x":1},{"width":128,"y":374,"height":89,"name":"猫咪躺在木板(1)(1)/帽子","x":152},{"width":128,"y":239,"height":90,"name":"猫咪躺在木板(1)(1)/眼睛2","x":381},{"width":128,"y":331,"height":90,"name":"猫咪躺在木板(1)(1)/眼睛","x":381},{"width":144,"y":423,"height":77,"name":"猫咪躺在木板(1)(1)/眼镜","x":1},{"width":25,"y":374,"height":23,"name":"猫咪躺在木板(1)(1)/鼻子","x":336},{"width":53,"y":405,"height":11,"name":"猫咪躺在木板(1)(1)/嘴1","x":282},{"width":52,"y":374,"height":29,"name":"猫咪躺在木板(1)(1)/嘴2","x":282},{"width":103,"y":522,"height":48,"name":"猫咪躺在木板(1)(1)/眉毛","x":275},{"width":149,"y":325,"height":96,"name":"猫咪躺在木板(1)(1)/胡须","x":1},{"width":104,"y":423,"height":97,"name":"猫咪躺在木板(1)(1)/_左手","x":282},{"width":112,"y":239,"height":133,"name":"猫咪躺在木板(1)(1)/领带","x":267}]}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "735dbebe-fae0-4915-8a87-d8dad6acf5ef",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "eeb40856-662a-4192-a88b-197b04bfa4f5",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 512,
"height": 1024,
"platformSettings": {},
"subMetas": {
"猫咪躺在木板_tex": {
"ver": "1.0.4",
"uuid": "b3301638-ee91-4c6c-acef-78bbbe4a3644",
"rawTextureUuid": "eeb40856-662a-4192-a88b-197b04bfa4f5",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -1,
"offsetY": 204.5,
"trimX": 1,
"trimY": 1,
"width": 508,
"height": 613,
"rawWidth": 512,
"rawHeight": 1024,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
......@@ -157,7 +157,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
});
if (this._status.round == 0 && serverStatus.round == 1) {
this._status.round = serverStatus.round;
this.playAudioByUrl(this.data.audioOnEnterGame);
this.coolCatSay(this.data.audioOnEnterGame);
this.initCountDown(this.onTimerFinish.bind(this));
this.initBoats();
} else {
......@@ -180,9 +180,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
showWin() {
if (this._status.boats.every(boat => boat[this.playerId])) {
this.playAudioByUrl(this.data.audioWinInTime);
this.coolCatSay(this.data.audioWinInTime);
} else {
this.playAudioByUrl(this.data.audioWinOutTime);
this.coolCatSay(this.data.audioWinOutTime);
}
const youWin = cc.find('Canvas/bg/youWin');
youWin.active = true;
......@@ -196,9 +196,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
showLoss() {
if (this._status.boats.every(boat => boat[this.playerId])) {
this.playAudioByUrl(this.data.audioLossInTime);
this.coolCatSay(this.data.audioLossInTime);
} else {
this.playAudioByUrl(this.data.audioLossOutTime);
this.coolCatSay(this.data.audioLossOutTime);
}
const youLoss = cc.find('Canvas/bg/youLoss');
youLoss.active = true;
......@@ -235,7 +235,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
async initView() {
this.playAudioByUrl(this.data.audioOnEnterMatch);
this.coolCatSay(this.data.audioOnEnterMatch);
this.initProgress();
this.initBubbles();
this.initLoadingLayer();
......@@ -252,10 +252,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
startQuestionFirstTime = true;
async startQuestion(idx: number) {
if (this.startQuestionFirstTime) {
this.startQuestionFirstTime = false;
this.playAudioByUrl(this.data.audioOnFirstTest);
}
this.showTestFrame();
this.showTestImage(idx);
const words = [
......@@ -267,7 +263,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.startTest(words[idx]);
this.coolCatSay(this.data.startAudio);
if (this.startQuestionFirstTime) {
this.startQuestionFirstTime = false;
await this.testCoolCatSay(this.data.audioOnFirstTest);
}
this.testCoolCatSay(this.data.startAudio);
await this.testCountDown(this.data.testDuration);
const score = await this.stopTest();
if (score > 80) {
......@@ -332,12 +332,23 @@ export default class SceneComponent extends MyCocosSceneComponent {
const testBg = cc.find('Canvas/testBg');
testBg.active = false;
}
coolCatSay(startAudio: string) {
testCoolCatSay(audioUrl: string) {
return new Promise((resolve) => {
const coolcat = cc.find('Canvas/testBg/coolcatbg/coolcat');
const display = coolcat.getComponent(dragonBones.ArmatureDisplay);
display.playAnimation('begin', -1);
this.playAudioByUrl(startAudio, () => {
this.playAudioByUrl(audioUrl, () => {
display.playAnimation('normal', -1);
resolve(null);
});
});
}
coolCatSay(audioUrl: string) {
return new Promise((resolve) => {
const coolCat = cc.find('Canvas/bg/coolCatBase/coolCat');
const display = coolCat.getComponent(dragonBones.ArmatureDisplay);
display.playAnimation('talk', -1);
this.playAudioByUrl(audioUrl, () => {
display.playAnimation('normal', -1);
resolve(null);
});
......
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