Commit 3719ae1b authored by 李维's avatar 李维

添加音频

parent 3bc543da
......@@ -80,7 +80,7 @@ cc.Class({
// onLoad () {},
_timeoutID: null,
isStop: true,
isStop: null,
start() {},
init(audio_url, testTime) {
this.audioBeforeTest = audio_url;
......@@ -120,6 +120,8 @@ cc.Class({
let url = this.recordWaitCount == 0 ? this.audioBeforeTest : "";
let cat = cc.find("cat", catBase);
asyncPlayDragonBoneAnimation(cat, "begin", 0);
// 录音前停止所有音频
cc.audioEngine.stopAll();
playAudioByUrl(url, () => {
if(this.isStop) {
return
......
......@@ -90,13 +90,10 @@
"__id__": 279
},
{
"__id__": 284
},
{
"__id__": 287
"__id__": 285
},
{
"__id__": 333
"__id__": 288
},
{
"__id__": 334
......@@ -105,19 +102,22 @@
"__id__": 335
},
{
"__id__": 417
"__id__": 336
},
{
"__id__": 418
}
],
"_active": true,
"_components": [
{
"__id__": 425
},
{
"__id__": 426
},
{
"__id__": 427
},
{
"__id__": 428
}
],
"_prefab": null,
......@@ -13872,15 +13872,18 @@
"_children": [
{
"__id__": 280
},
{
"__id__": 282
}
],
"_active": true,
"_components": [
{
"__id__": 282
"__id__": 283
},
{
"__id__": 283
"__id__": 284
}
],
"_prefab": null,
......@@ -13968,8 +13971,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-415.773,
365.514,
-409.94,
371.347,
0,
0,
0,
......@@ -14033,6 +14036,64 @@
"_N$enableBatch": false,
"_id": "0bHI4khJZNmrURpK/d85Sq"
},
{
"__type__": "cc.Node",
"_name": "click",
"_objFlags": 0,
"_parent": {
"__id__": 279
},
"_children": [],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 200,
"height": 250
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
39.375,
113.75,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "69sS9rHcpBr51w5xUii8c3"
},
{
"__type__": "cc.Sprite",
"_name": "",
......@@ -14101,13 +14162,13 @@
},
"_children": [
{
"__id__": 285
"__id__": 286
}
],
"_active": true,
"_components": [
{
"__id__": 286
"__id__": 287
}
],
"_prefab": null,
......@@ -14163,7 +14224,7 @@
"_name": "map",
"_objFlags": 0,
"_parent": {
"__id__": 284
"__id__": 285
},
"_children": [],
"_active": true,
......@@ -14221,7 +14282,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 284
"__id__": 285
},
"_enabled": true,
"_materials": [
......@@ -14265,44 +14326,44 @@
},
"_children": [
{
"__id__": 288
"__id__": 289
},
{
"__id__": 292
"__id__": 293
},
{
"__id__": 295
"__id__": 296
},
{
"__id__": 304
"__id__": 305
},
{
"__id__": 306
"__id__": 307
},
{
"__id__": 313
"__id__": 314
},
{
"__id__": 316
"__id__": 317
},
{
"__id__": 319
"__id__": 320
},
{
"__id__": 322
"__id__": 323
}
],
"_active": false,
"_components": [
{
"__id__": 330
"__id__": 331
},
{
"__id__": 331
"__id__": 332
}
],
"_prefab": {
"__id__": 332
"__id__": 333
},
"_opacity": 255,
"_color": {
......@@ -14356,20 +14417,20 @@
"_name": "gray",
"_objFlags": 0,
"_parent": {
"__id__": 287
"__id__": 288
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 289
"__id__": 290
},
{
"__id__": 290
"__id__": 291
}
],
"_prefab": {
"__id__": 291
"__id__": 292
},
"_opacity": 150,
"_color": {
......@@ -14423,7 +14484,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 288
"__id__": 289
},
"_enabled": true,
"_materials": [
......@@ -14455,7 +14516,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 288
"__id__": 289
},
"_enabled": true,
"alignMode": 1,
......@@ -14480,7 +14541,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 287
"__id__": 288
},
"asset": {
"__uuid__": "87e8bdef-072f-4642-b630-352bb34d47b4"
......@@ -14493,17 +14554,17 @@
"_name": "voice_bg",
"_objFlags": 0,
"_parent": {
"__id__": 287
"__id__": 288
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 293
"__id__": 294
}
],
"_prefab": {
"__id__": 294
"__id__": 295
},
"_opacity": 255,
"_color": {
......@@ -14557,7 +14618,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 292
"__id__": 293
},
"_enabled": true,
"_materials": [
......@@ -14587,7 +14648,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 287
"__id__": 288
},
"asset": {
"__uuid__": "87e8bdef-072f-4642-b630-352bb34d47b4"
......@@ -14600,24 +14661,24 @@
"_name": "catBase",
"_objFlags": 0,
"_parent": {
"__id__": 287
"__id__": 288
},
"_children": [
{
"__id__": 296
"__id__": 297
},
{
"__id__": 299
"__id__": 300
}
],
"_active": true,
"_components": [
{
"__id__": 302
"__id__": 303
}
],
"_prefab": {
"__id__": 303
"__id__": 304
},
"_opacity": 255,
"_color": {
......@@ -14671,17 +14732,17 @@
"_name": "cat",
"_objFlags": 0,
"_parent": {
"__id__": 295
"__id__": 296
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 297
"__id__": 298
}
],
"_prefab": {
"__id__": 298
"__id__": 299
},
"_opacity": 255,
"_color": {
......@@ -14735,7 +14796,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 296
"__id__": 297
},
"_enabled": true,
"_materials": [
......@@ -14773,7 +14834,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 287
"__id__": 288
},
"asset": {
"__uuid__": "87e8bdef-072f-4642-b630-352bb34d47b4"
......@@ -14786,17 +14847,17 @@
"_name": "catBtn",
"_objFlags": 0,
"_parent": {
"__id__": 295
"__id__": 296
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 300
"__id__": 301
}
],
"_prefab": {
"__id__": 301
"__id__": 302
},
"_opacity": 255,
"_color": {
......@@ -14850,7 +14911,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 299
"__id__": 300
},
"_enabled": true,
"_normalMaterial": null,
......@@ -14916,7 +14977,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 287
"__id__": 288
},
"asset": {
"__uuid__": "87e8bdef-072f-4642-b630-352bb34d47b4"
......@@ -14929,7 +14990,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 295
"__id__": 296
},
"_enabled": true,
"alignMode": 1,
......@@ -14954,7 +15015,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 287
"__id__": 288
},
"asset": {
"__uuid__": "87e8bdef-072f-4642-b630-352bb34d47b4"
......@@ -14967,13 +15028,13 @@
"_name": "img",
"_objFlags": 0,
"_parent": {
"__id__": 287
"__id__": 288
},
"_children": [],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 305
"__id__": 306
},
"_opacity": 255,
"_color": {
......@@ -15025,7 +15086,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 287
"__id__": 288
},
"asset": {
"__uuid__": "87e8bdef-072f-4642-b630-352bb34d47b4"
......@@ -15038,24 +15099,24 @@
"_name": "progress",
"_objFlags": 0,
"_parent": {
"__id__": 287
"__id__": 288
},
"_children": [
{
"__id__": 307
"__id__": 308
}
],
"_active": true,
"_components": [
{
"__id__": 310
"__id__": 311
},
{
"__id__": 311
"__id__": 312
}
],
"_prefab": {
"__id__": 312
"__id__": 313
},
"_opacity": 255,
"_color": {
......@@ -15109,17 +15170,17 @@
"_name": "bar",
"_objFlags": 0,
"_parent": {
"__id__": 306
"__id__": 307
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 308
"__id__": 309
}
],
"_prefab": {
"__id__": 309
"__id__": 310
},
"_opacity": 255,
"_color": {
......@@ -15173,7 +15234,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 307
"__id__": 308
},
"_enabled": true,
"_materials": [
......@@ -15203,7 +15264,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 287
"__id__": 288
},
"asset": {
"__uuid__": "87e8bdef-072f-4642-b630-352bb34d47b4"
......@@ -15216,7 +15277,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 306
"__id__": 307
},
"_enabled": true,
"_materials": [
......@@ -15248,12 +15309,12 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 306
"__id__": 307
},
"_enabled": true,
"_N$totalLength": 787,
"_N$barSprite": {
"__id__": 308
"__id__": 309
},
"_N$mode": 0,
"_N$progress": 1,
......@@ -15263,7 +15324,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 287
"__id__": 288
},
"asset": {
"__uuid__": "87e8bdef-072f-4642-b630-352bb34d47b4"
......@@ -15276,17 +15337,17 @@
"_name": "bg_light",
"_objFlags": 0,
"_parent": {
"__id__": 287
"__id__": 288
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 314
"__id__": 315
}
],
"_prefab": {
"__id__": 315
"__id__": 316
},
"_opacity": 255,
"_color": {
......@@ -15340,7 +15401,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 313
"__id__": 314
},
"_enabled": true,
"_materials": [
......@@ -15370,7 +15431,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 287
"__id__": 288
},
"asset": {
"__uuid__": "87e8bdef-072f-4642-b630-352bb34d47b4"
......@@ -15383,17 +15444,17 @@
"_name": "good",
"_objFlags": 0,
"_parent": {
"__id__": 287
"__id__": 288
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 317
"__id__": 318
}
],
"_prefab": {
"__id__": 318
"__id__": 319
},
"_opacity": 255,
"_color": {
......@@ -15447,7 +15508,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 316
"__id__": 317
},
"_enabled": true,
"_materials": [
......@@ -15477,7 +15538,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 287
"__id__": 288
},
"asset": {
"__uuid__": "87e8bdef-072f-4642-b630-352bb34d47b4"
......@@ -15490,17 +15551,17 @@
"_name": "try",
"_objFlags": 0,
"_parent": {
"__id__": 287
"__id__": 288
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 320
"__id__": 321
}
],
"_prefab": {
"__id__": 321
"__id__": 322
},
"_opacity": 255,
"_color": {
......@@ -15554,7 +15615,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 319
"__id__": 320
},
"_enabled": true,
"_materials": [
......@@ -15584,7 +15645,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 287
"__id__": 288
},
"asset": {
"__uuid__": "87e8bdef-072f-4642-b630-352bb34d47b4"
......@@ -15597,20 +15658,20 @@
"_name": "audioClips",
"_objFlags": 0,
"_parent": {
"__id__": 287
"__id__": 288
},
"_children": [
{
"__id__": 323
"__id__": 324
},
{
"__id__": 326
"__id__": 327
}
],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 329
"__id__": 330
},
"_opacity": 255,
"_color": {
......@@ -15664,17 +15725,17 @@
"_name": "right",
"_objFlags": 0,
"_parent": {
"__id__": 322
"__id__": 323
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 324
"__id__": 325
}
],
"_prefab": {
"__id__": 325
"__id__": 326
},
"_opacity": 255,
"_color": {
......@@ -15728,7 +15789,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 323
"__id__": 324
},
"_enabled": true,
"_clip": {
......@@ -15745,7 +15806,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 287
"__id__": 288
},
"asset": {
"__uuid__": "87e8bdef-072f-4642-b630-352bb34d47b4"
......@@ -15758,17 +15819,17 @@
"_name": "wrong",
"_objFlags": 0,
"_parent": {
"__id__": 322
"__id__": 323
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 327
"__id__": 328
}
],
"_prefab": {
"__id__": 328
"__id__": 329
},
"_opacity": 255,
"_color": {
......@@ -15822,7 +15883,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 326
"__id__": 327
},
"_enabled": true,
"_clip": {
......@@ -15839,7 +15900,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 287
"__id__": 288
},
"asset": {
"__uuid__": "87e8bdef-072f-4642-b630-352bb34d47b4"
......@@ -15850,7 +15911,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 287
"__id__": 288
},
"asset": {
"__uuid__": "87e8bdef-072f-4642-b630-352bb34d47b4"
......@@ -15863,7 +15924,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 287
"__id__": 288
},
"_enabled": true,
"alignMode": 1,
......@@ -15890,7 +15951,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 287
"__id__": 288
},
"_enabled": true,
"audioBeforeTest": "",
......@@ -15901,7 +15962,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 287
"__id__": 288
},
"asset": {
"__uuid__": "87e8bdef-072f-4642-b630-352bb34d47b4"
......@@ -16034,25 +16095,25 @@
},
"_children": [
{
"__id__": 336
"__id__": 337
},
{
"__id__": 339
"__id__": 340
},
{
"__id__": 341
"__id__": 342
},
{
"__id__": 346
"__id__": 347
},
{
"__id__": 381
"__id__": 382
}
],
"_active": false,
"_components": [
{
"__id__": 416
"__id__": 417
}
],
"_prefab": null,
......@@ -16108,16 +16169,16 @@
"_name": "gray",
"_objFlags": 0,
"_parent": {
"__id__": 335
"__id__": 336
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 337
"__id__": 338
},
{
"__id__": 338
"__id__": 339
}
],
"_prefab": null,
......@@ -16173,7 +16234,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 336
"__id__": 337
},
"_enabled": true,
"_materials": [
......@@ -16205,7 +16266,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 336
"__id__": 337
},
"_enabled": true,
"alignMode": 1,
......@@ -16232,13 +16293,13 @@
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 335
"__id__": 336
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 340
"__id__": 341
}
],
"_prefab": null,
......@@ -16294,7 +16355,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 339
"__id__": 340
},
"_enabled": true,
"_materials": [
......@@ -16326,14 +16387,14 @@
"_name": "map",
"_objFlags": 0,
"_parent": {
"__id__": 335
"__id__": 336
},
"_children": [
{
"__id__": 342
"__id__": 343
},
{
"__id__": 344
"__id__": 345
}
],
"_active": true,
......@@ -16391,13 +16452,13 @@
"_name": "light",
"_objFlags": 0,
"_parent": {
"__id__": 341
"__id__": 342
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 343
"__id__": 344
}
],
"_prefab": null,
......@@ -16453,7 +16514,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 342
"__id__": 343
},
"_enabled": true,
"_materials": [
......@@ -16485,13 +16546,13 @@
"_name": "map",
"_objFlags": 0,
"_parent": {
"__id__": 341
"__id__": 342
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 345
"__id__": 346
}
],
"_prefab": null,
......@@ -16547,7 +16608,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 344
"__id__": 345
},
"_enabled": true,
"_materials": [
......@@ -16579,26 +16640,26 @@
"_name": "red",
"_objFlags": 0,
"_parent": {
"__id__": 335
"__id__": 336
},
"_children": [
{
"__id__": 347
"__id__": 348
},
{
"__id__": 350
"__id__": 351
},
{
"__id__": 361
"__id__": 362
},
{
"__id__": 365
"__id__": 366
},
{
"__id__": 375
"__id__": 376
},
{
"__id__": 379
"__id__": 380
}
],
"_active": true,
......@@ -16656,11 +16717,11 @@
"_name": "people",
"_objFlags": 0,
"_parent": {
"__id__": 346
"__id__": 347
},
"_children": [
{
"__id__": 348
"__id__": 349
}
],
"_active": true,
......@@ -16718,13 +16779,13 @@
"_name": "db",
"_objFlags": 0,
"_parent": {
"__id__": 347
"__id__": 348
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 349
"__id__": 350
}
],
"_prefab": null,
......@@ -16780,7 +16841,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 348
"__id__": 349
},
"_enabled": true,
"_materials": [
......@@ -16820,23 +16881,23 @@
"_name": "gems",
"_objFlags": 0,
"_parent": {
"__id__": 346
"__id__": 347
},
"_children": [
{
"__id__": 351
"__id__": 352
},
{
"__id__": 353
"__id__": 354
},
{
"__id__": 355
"__id__": 356
},
{
"__id__": 357
"__id__": 358
},
{
"__id__": 359
"__id__": 360
}
],
"_active": true,
......@@ -16894,13 +16955,13 @@
"_name": "gem25",
"_objFlags": 0,
"_parent": {
"__id__": 350
"__id__": 351
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 352
"__id__": 353
}
],
"_prefab": null,
......@@ -16956,7 +17017,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 351
"__id__": 352
},
"_enabled": true,
"_materials": [
......@@ -16988,13 +17049,13 @@
"_name": "gem15",
"_objFlags": 0,
"_parent": {
"__id__": 350
"__id__": 351
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 354
"__id__": 355
}
],
"_prefab": null,
......@@ -17050,7 +17111,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 353
"__id__": 354
},
"_enabled": true,
"_materials": [
......@@ -17082,13 +17143,13 @@
"_name": "gem20",
"_objFlags": 0,
"_parent": {
"__id__": 350
"__id__": 351
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 356
"__id__": 357
}
],
"_prefab": null,
......@@ -17144,7 +17205,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 355
"__id__": 356
},
"_enabled": true,
"_materials": [
......@@ -17176,13 +17237,13 @@
"_name": "gem5",
"_objFlags": 0,
"_parent": {
"__id__": 350
"__id__": 351
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 358
"__id__": 359
}
],
"_prefab": null,
......@@ -17238,7 +17299,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 357
"__id__": 358
},
"_enabled": true,
"_materials": [
......@@ -17270,13 +17331,13 @@
"_name": "gem10",
"_objFlags": 0,
"_parent": {
"__id__": 350
"__id__": 351
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 360
"__id__": 361
}
],
"_prefab": null,
......@@ -17332,7 +17393,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 359
"__id__": 360
},
"_enabled": true,
"_materials": [
......@@ -17364,17 +17425,17 @@
"_name": "bag",
"_objFlags": 0,
"_parent": {
"__id__": 346
"__id__": 347
},
"_children": [
{
"__id__": 362
"__id__": 363
}
],
"_active": true,
"_components": [
{
"__id__": 364
"__id__": 365
}
],
"_prefab": null,
......@@ -17430,13 +17491,13 @@
"_name": "score",
"_objFlags": 0,
"_parent": {
"__id__": 361
"__id__": 362
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 363
"__id__": 364
}
],
"_prefab": null,
......@@ -17492,7 +17553,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 362
"__id__": 363
},
"_enabled": true,
"_materials": [
......@@ -17525,7 +17586,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 361
"__id__": 362
},
"_enabled": true,
"_materials": [
......@@ -17557,17 +17618,17 @@
"_name": "header",
"_objFlags": 0,
"_parent": {
"__id__": 346
"__id__": 347
},
"_children": [
{
"__id__": 366
"__id__": 367
},
{
"__id__": 368
"__id__": 369
},
{
"__id__": 371
"__id__": 372
}
],
"_active": true,
......@@ -17625,13 +17686,13 @@
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 365
"__id__": 366
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 367
"__id__": 368
}
],
"_prefab": null,
......@@ -17687,7 +17748,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 366
"__id__": 367
},
"_enabled": true,
"_materials": [
......@@ -17719,16 +17780,16 @@
"_name": "image",
"_objFlags": 0,
"_parent": {
"__id__": 365
"__id__": 366
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 369
"__id__": 370
},
{
"__id__": 370
"__id__": 371
}
],
"_prefab": null,
......@@ -17784,7 +17845,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 368
"__id__": 369
},
"_enabled": true,
"_materials": [
......@@ -17814,7 +17875,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 368
"__id__": 369
},
"_enabled": true,
"fixedSize": 140,
......@@ -17825,17 +17886,17 @@
"_name": "mask",
"_objFlags": 0,
"_parent": {
"__id__": 365
"__id__": 366
},
"_children": [
{
"__id__": 372
"__id__": 373
}
],
"_active": false,
"_components": [
{
"__id__": 374
"__id__": 375
}
],
"_prefab": null,
......@@ -17891,13 +17952,13 @@
"_name": "color",
"_objFlags": 0,
"_parent": {
"__id__": 371
"__id__": 372
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 373
"__id__": 374
}
],
"_prefab": null,
......@@ -17953,7 +18014,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 372
"__id__": 373
},
"_enabled": true,
"_materials": [
......@@ -17985,7 +18046,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 371
"__id__": 372
},
"_enabled": true,
"_materials": [
......@@ -18005,17 +18066,17 @@
"_name": "name",
"_objFlags": 0,
"_parent": {
"__id__": 346
"__id__": 347
},
"_children": [
{
"__id__": 376
"__id__": 377
}
],
"_active": true,
"_components": [
{
"__id__": 378
"__id__": 379
}
],
"_prefab": null,
......@@ -18071,13 +18132,13 @@
"_name": "label",
"_objFlags": 0,
"_parent": {
"__id__": 375
"__id__": 376
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 377
"__id__": 378
}
],
"_prefab": null,
......@@ -18133,7 +18194,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 376
"__id__": 377
},
"_enabled": true,
"_materials": [
......@@ -18166,7 +18227,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 375
"__id__": 376
},
"_enabled": true,
"_materials": [
......@@ -18198,13 +18259,13 @@
"_name": "master",
"_objFlags": 0,
"_parent": {
"__id__": 346
"__id__": 347
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 380
"__id__": 381
}
],
"_prefab": null,
......@@ -18260,7 +18321,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 379
"__id__": 380
},
"_enabled": true,
"_materials": [
......@@ -18292,26 +18353,26 @@
"_name": "blue",
"_objFlags": 0,
"_parent": {
"__id__": 335
"__id__": 336
},
"_children": [
{
"__id__": 382
"__id__": 383
},
{
"__id__": 385
"__id__": 386
},
{
"__id__": 396
"__id__": 397
},
{
"__id__": 400
"__id__": 401
},
{
"__id__": 410
"__id__": 411
},
{
"__id__": 414
"__id__": 415
}
],
"_active": true,
......@@ -18369,11 +18430,11 @@
"_name": "people",
"_objFlags": 0,
"_parent": {
"__id__": 381
"__id__": 382
},
"_children": [
{
"__id__": 383
"__id__": 384
}
],
"_active": true,
......@@ -18431,13 +18492,13 @@
"_name": "db",
"_objFlags": 0,
"_parent": {
"__id__": 382
"__id__": 383
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 384
"__id__": 385
}
],
"_prefab": null,
......@@ -18493,7 +18554,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 383
"__id__": 384
},
"_enabled": true,
"_materials": [
......@@ -18533,23 +18594,23 @@
"_name": "gems",
"_objFlags": 0,
"_parent": {
"__id__": 381
"__id__": 382
},
"_children": [
{
"__id__": 386
"__id__": 387
},
{
"__id__": 388
"__id__": 389
},
{
"__id__": 390
"__id__": 391
},
{
"__id__": 392
"__id__": 393
},
{
"__id__": 394
"__id__": 395
}
],
"_active": true,
......@@ -18607,13 +18668,13 @@
"_name": "gem25",
"_objFlags": 0,
"_parent": {
"__id__": 385
"__id__": 386
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 387
"__id__": 388
}
],
"_prefab": null,
......@@ -18669,7 +18730,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 386
"__id__": 387
},
"_enabled": true,
"_materials": [
......@@ -18701,13 +18762,13 @@
"_name": "gem15",
"_objFlags": 0,
"_parent": {
"__id__": 385
"__id__": 386
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 389
"__id__": 390
}
],
"_prefab": null,
......@@ -18763,7 +18824,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 388
"__id__": 389
},
"_enabled": true,
"_materials": [
......@@ -18795,13 +18856,13 @@
"_name": "gem20",
"_objFlags": 0,
"_parent": {
"__id__": 385
"__id__": 386
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 391
"__id__": 392
}
],
"_prefab": null,
......@@ -18857,7 +18918,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 390
"__id__": 391
},
"_enabled": true,
"_materials": [
......@@ -18889,13 +18950,13 @@
"_name": "gem5",
"_objFlags": 0,
"_parent": {
"__id__": 385
"__id__": 386
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 393
"__id__": 394
}
],
"_prefab": null,
......@@ -18951,7 +19012,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 392
"__id__": 393
},
"_enabled": true,
"_materials": [
......@@ -18983,13 +19044,13 @@
"_name": "gem10",
"_objFlags": 0,
"_parent": {
"__id__": 385
"__id__": 386
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 395
"__id__": 396
}
],
"_prefab": null,
......@@ -19045,7 +19106,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 394
"__id__": 395
},
"_enabled": true,
"_materials": [
......@@ -19077,17 +19138,17 @@
"_name": "bag",
"_objFlags": 0,
"_parent": {
"__id__": 381
"__id__": 382
},
"_children": [
{
"__id__": 397
"__id__": 398
}
],
"_active": true,
"_components": [
{
"__id__": 399
"__id__": 400
}
],
"_prefab": null,
......@@ -19143,13 +19204,13 @@
"_name": "score",
"_objFlags": 0,
"_parent": {
"__id__": 396
"__id__": 397
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 398
"__id__": 399
}
],
"_prefab": null,
......@@ -19205,7 +19266,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 397
"__id__": 398
},
"_enabled": true,
"_materials": [
......@@ -19238,7 +19299,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 396
"__id__": 397
},
"_enabled": true,
"_materials": [
......@@ -19270,17 +19331,17 @@
"_name": "header",
"_objFlags": 0,
"_parent": {
"__id__": 381
"__id__": 382
},
"_children": [
{
"__id__": 401
"__id__": 402
},
{
"__id__": 403
"__id__": 404
},
{
"__id__": 406
"__id__": 407
}
],
"_active": true,
......@@ -19338,13 +19399,13 @@
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 400
"__id__": 401
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 402
"__id__": 403
}
],
"_prefab": null,
......@@ -19400,7 +19461,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 401
"__id__": 402
},
"_enabled": true,
"_materials": [
......@@ -19432,16 +19493,16 @@
"_name": "image",
"_objFlags": 0,
"_parent": {
"__id__": 400
"__id__": 401
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 404
"__id__": 405
},
{
"__id__": 405
"__id__": 406
}
],
"_prefab": null,
......@@ -19497,7 +19558,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 403
"__id__": 404
},
"_enabled": true,
"_materials": [
......@@ -19527,7 +19588,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 403
"__id__": 404
},
"_enabled": true,
"fixedSize": 140,
......@@ -19538,17 +19599,17 @@
"_name": "mask",
"_objFlags": 0,
"_parent": {
"__id__": 400
"__id__": 401
},
"_children": [
{
"__id__": 407
"__id__": 408
}
],
"_active": false,
"_components": [
{
"__id__": 409
"__id__": 410
}
],
"_prefab": null,
......@@ -19604,13 +19665,13 @@
"_name": "color",
"_objFlags": 0,
"_parent": {
"__id__": 406
"__id__": 407
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 408
"__id__": 409
}
],
"_prefab": null,
......@@ -19666,7 +19727,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 407
"__id__": 408
},
"_enabled": true,
"_materials": [
......@@ -19698,7 +19759,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 406
"__id__": 407
},
"_enabled": true,
"_materials": [
......@@ -19718,17 +19779,17 @@
"_name": "name",
"_objFlags": 0,
"_parent": {
"__id__": 381
"__id__": 382
},
"_children": [
{
"__id__": 411
"__id__": 412
}
],
"_active": true,
"_components": [
{
"__id__": 413
"__id__": 414
}
],
"_prefab": null,
......@@ -19784,13 +19845,13 @@
"_name": "label",
"_objFlags": 0,
"_parent": {
"__id__": 410
"__id__": 411
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 412
"__id__": 413
}
],
"_prefab": null,
......@@ -19846,7 +19907,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 411
"__id__": 412
},
"_enabled": true,
"_materials": [
......@@ -19879,7 +19940,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 410
"__id__": 411
},
"_enabled": true,
"_materials": [
......@@ -19911,13 +19972,13 @@
"_name": "master",
"_objFlags": 0,
"_parent": {
"__id__": 381
"__id__": 382
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 415
"__id__": 416
}
],
"_prefab": null,
......@@ -19973,7 +20034,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 414
"__id__": 415
},
"_enabled": true,
"_materials": [
......@@ -20005,7 +20066,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 335
"__id__": 336
},
"_enabled": true,
"alignMode": 1,
......@@ -20036,13 +20097,13 @@
},
"_children": [
{
"__id__": 418
"__id__": 419
},
{
"__id__": 421
"__id__": 422
},
{
"__id__": 422
"__id__": 423
}
],
"_active": false,
......@@ -20100,11 +20161,11 @@
"_name": "font",
"_objFlags": 0,
"_parent": {
"__id__": 417
"__id__": 418
},
"_children": [
{
"__id__": 419
"__id__": 420
}
],
"_active": true,
......@@ -20162,13 +20223,13 @@
"_name": "BRLNSDB",
"_objFlags": 0,
"_parent": {
"__id__": 418
"__id__": 419
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 420
"__id__": 421
}
],
"_prefab": null,
......@@ -20224,7 +20285,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 419
"__id__": 420
},
"_enabled": true,
"_materials": [],
......@@ -20255,7 +20316,7 @@
"_name": "img",
"_objFlags": 0,
"_parent": {
"__id__": 417
"__id__": 418
},
"_children": [],
"_active": true,
......@@ -20313,11 +20374,11 @@
"_name": "audio",
"_objFlags": 0,
"_parent": {
"__id__": 417
"__id__": 418
},
"_children": [
{
"__id__": 423
"__id__": 424
}
],
"_active": true,
......@@ -20375,13 +20436,13 @@
"_name": "btn",
"_objFlags": 512,
"_parent": {
"__id__": 422
"__id__": 423
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 424
"__id__": 425
}
],
"_prefab": null,
......@@ -20437,7 +20498,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 423
"__id__": 424
},
"_enabled": true,
"_clip": {
......
......@@ -27,7 +27,7 @@ const MSG_PLAYER_TO_HOME = "msg_player_to_home";
const MSG_PROFIX_END = "__END__";
const DEBUG = false;
const TOTAL_SCORE = 42; // 总分 - 双方分数之和等于 TOTAL_SCORE
const AI_SUCCESS_RATE = 0.7; // ai评测成功率
const AI_SUCCESS_RATE = 0.65; // ai评测成功率
const AUTO_GAME = false; // 自动游戏-调试使用
@ccclass
......@@ -45,9 +45,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
networkHelper: NetworkHelper;
playerId; // 当前玩家ID
isRoomOwner; // 是否为房主
recordWaitCount; // 录音等待倒计时
withAiPlayer=false; // 对手是否AI
gameEnd = false;
gameStaring = false;
addPreloadImage() {
// TODO 根据自己的配置预加载图片资源
......@@ -58,6 +58,16 @@ export default class SceneComponent extends MyCocosSceneComponent {
addPreloadAudio() {
// TODO 根据自己的配置预加载音频资源
// this._audioResList.push({ url: this.data.audio_url });
// 游戏加载
this._audioResList.push({ url: this.data.gameLoadingAudio });
// 游戏开始
this._audioResList.push({ url: this.data.gameStartAudio });
// 提示录音
this._audioResList.push({ url: this.data.recordWait });
this._audioResList.push({ url: this.data.waitingPiece });
this._audioResList.push({ url: this.data.waitingTurn });
this._audioResList.push({ url: this.data.waitingWheel });
}
addPreloadAnima() {}
......@@ -103,7 +113,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.server.onAIEvents = this.onAiEvents.bind(this);
}
await this.initHeadImgAndName();
this.recordWaitCount = 0;
}
// 获取用户头像
......@@ -202,6 +211,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.initSide();
this.timerHandle = this.initTimer();
this.initPlayerInfo();
this.coolcatSpeak(this.data.gameStartAudio, "begin", ()=>{
this.gameStaring = true;
});
// 自动游戏模式 - 调试使用
if(AUTO_GAME) {
this.turntable.stopBlink();
......@@ -209,6 +221,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.runEvent(MSG_ROLLING, {nextGem: nextGem});
}
});
this.coolcatSpeak(this.data.gameLoadingAudio, "begin");
}
// 初始化掉线提示组件
......@@ -262,8 +275,23 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 初始化酷猫
coolCat = null;
coolCatClick = null;
coolCatAudioUrl = null;
initCoolCat() {
this.coolCat = cc.find("Canvas/coolcatLand/coolcat");
this.coolCatClick = cc.find("Canvas/coolcatLand/click");
this.coolCatAudioUrl = this.data.waitingWheel;
this.coolCatClick.on(cc.Node.EventType.TOUCH_END, ()=>{
if(this.gameStaring) {
if(this.side == this.currentGameSide) {
if(this.coolCatAudioUrl) {
this.coolcatSpeak(this.coolCatAudioUrl, "right")
}
} else {
this.coolcatSpeak(this.data.waitingTurn, "right")
}
}
})
}
seagull = null;
......@@ -866,6 +894,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.turntable.initTurntable(DEBUG);
cc.find("Canvas/Turntable").on("Rolling_Start", ()=>{
// 游戏流程1: 玩家点击转盘
if(!this.gameStaring) {
return;
}
this.turntable.stopBlink();
const nextGem = this.getNextQuestionIndex();
this.runEvent(MSG_ROLLING, {nextGem: nextGem});
......@@ -939,6 +970,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 换边
this.registerEvent(MSG_SWITCHSIDE, (param, next)=>{
this.currentGameSide = param.side;
this.coolCatAudioUrl = this.data.waitingWheel;
this.handleSwitchSide();
next();
})
......@@ -1003,6 +1035,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 转盘
this.registerEvent(MSG_ROLLING, (param, next)=>{
// console.log("转盘结果:", param.nextGem)
cc.audioEngine.stopAll();
this.coolCatAudioUrl = this.data.waitingPiece;
this.turntable.stopBlink();
this.turntable.rollNum(param.nextGem.score).then(()=>{
// 异步操作执行完成后调用
......@@ -1242,4 +1276,25 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 重置转盘
this.turntable.reset();
}
// 酷猫说话
audioID = null;
coolcatSpeak(url, aniName = "normal", callback?) {
if(url) {
console.log(aniName)
asyncPlayDragonBoneAnimation(this.coolCat, aniName, 0);
if(this.audioID) {
cc.audioEngine.stop(this.audioID);
}
this.playAudioByUrl(url, ()=>{
this.audioID=null;
if(callback) {
callback();
}
}).then(id=>{
this.audioID = id;
asyncPlayDragonBoneAnimation(this.coolCat, "normal", 0);
})
}
}
}
export const defaultData = {
gameStartAudio:
"",
gameLoadingAudio:
"",
waitingWheel:
"",
waitingPiece:
"",
waitingTurn:
"",
recordWait: "http://staging-teach.cdn.ireadabc.com/31952573236dd316a8ee1672d1614a1c.mp3"
};
"gameStartAudio": "http://teach.cdn.ireadabc.com/46e8423adee1bde0837a26b84ea50e47.mp3",
"gameLoadingAudio": "http://teach.cdn.ireadabc.com/bb7f56145cabe28ce47e8a9280af58a3.mp3",
"waitingWheel": "http://teach.cdn.ireadabc.com/b50c22ab7d113d0f56cdeb327c88d2a9.mp3",
"waitingPiece": "http://teach.cdn.ireadabc.com/05cd6b07a5222b70320167224d33b397.mp3",
"waitingTurn": "http://teach.cdn.ireadabc.com/6bfd2437056b32967bf0830b45b2e6ae.mp3",
"recordWait": "http://staging-teach.cdn.ireadabc.com/31952573236dd316a8ee1672d1614a1c.mp3"
}
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