Commit ad4f646a authored by Li Mingzhe's avatar Li Mingzhe

fix: bug 1.0

parent d0bddc75
...@@ -90,13 +90,13 @@ ...@@ -90,13 +90,13 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 95 "__id__": 99
}, },
{ {
"__id__": 96 "__id__": 100
}, },
{ {
"__id__": 97 "__id__": 101
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3301,10 +3301,10 @@ ...@@ -3301,10 +3301,10 @@
"__id__": 70 "__id__": 70
}, },
{ {
"__id__": 81 "__id__": 85
}, },
{ {
"__id__": 84 "__id__": 88
} }
], ],
"_active": false, "_active": false,
...@@ -3379,6 +3379,12 @@ ...@@ -3379,6 +3379,12 @@
}, },
{ {
"__id__": 79 "__id__": 79
},
{
"__id__": 81
},
{
"__id__": 83
} }
], ],
"_active": true, "_active": true,
...@@ -3893,6 +3899,186 @@ ...@@ -3893,6 +3899,186 @@
"_atlas": null, "_atlas": null,
"_id": "28/zzuyulOb43Bbemj7re2" "_id": "28/zzuyulOb43Bbemj7re2"
}, },
{
"__type__": "cc.Node",
"_name": "icon_sound_2",
"_objFlags": 0,
"_parent": {
"__id__": 70
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 82
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 57,
"height": 61
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
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": "79BiUJtTZEGLyd/5+Z5y7M"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 81
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "53463ad2-6c62-4530-91bd-d4ad29e1528d"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "77sqIO51lJtZBbCCd+G0FH"
},
{
"__type__": "cc.Node",
"_name": "icon_sound",
"_objFlags": 0,
"_parent": {
"__id__": 70
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 84
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 57,
"height": 61
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
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": "5dveF08kRJyLcIstSPN+7e"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 83
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "5faab788-0d86-4511-998e-48214a855fbb"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "faxsGHVDNJQIuD3oP15gBE"
},
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "font", "_name": "font",
...@@ -3902,7 +4088,7 @@ ...@@ -3902,7 +4088,7 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 82 "__id__": 86
} }
], ],
"_active": true, "_active": true,
...@@ -3960,13 +4146,13 @@ ...@@ -3960,13 +4146,13 @@
"_name": "BRLNSR_1", "_name": "BRLNSR_1",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 81 "__id__": 85
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 83 "__id__": 87
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4022,7 +4208,7 @@ ...@@ -4022,7 +4208,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 82 "__id__": 86
}, },
"_enabled": true, "_enabled": true,
"_materials": [], "_materials": [],
...@@ -4058,19 +4244,19 @@ ...@@ -4058,19 +4244,19 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 85 "__id__": 89
}, },
{ {
"__id__": 87 "__id__": 91
}, },
{ {
"__id__": 89 "__id__": 93
}, },
{ {
"__id__": 91 "__id__": 95
}, },
{ {
"__id__": 93 "__id__": 97
} }
], ],
"_active": true, "_active": true,
...@@ -4128,13 +4314,13 @@ ...@@ -4128,13 +4314,13 @@
"_name": "down", "_name": "down",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 84 "__id__": 88
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 86 "__id__": 90
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4190,7 +4376,7 @@ ...@@ -4190,7 +4376,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 85 "__id__": 89
}, },
"_enabled": true, "_enabled": true,
"_clip": { "_clip": {
...@@ -4208,13 +4394,13 @@ ...@@ -4208,13 +4394,13 @@
"_name": "click", "_name": "click",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 84 "__id__": 88
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 88 "__id__": 92
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4270,7 +4456,7 @@ ...@@ -4270,7 +4456,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 87 "__id__": 91
}, },
"_enabled": true, "_enabled": true,
"_clip": { "_clip": {
...@@ -4288,13 +4474,13 @@ ...@@ -4288,13 +4474,13 @@
"_name": "right", "_name": "right",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 84 "__id__": 88
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 90 "__id__": 94
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4350,7 +4536,7 @@ ...@@ -4350,7 +4536,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 89 "__id__": 93
}, },
"_enabled": true, "_enabled": true,
"_clip": { "_clip": {
...@@ -4368,13 +4554,13 @@ ...@@ -4368,13 +4554,13 @@
"_name": "wrong", "_name": "wrong",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 84 "__id__": 88
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 92 "__id__": 96
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4430,7 +4616,7 @@ ...@@ -4430,7 +4616,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 91 "__id__": 95
}, },
"_enabled": true, "_enabled": true,
"_clip": { "_clip": {
...@@ -4448,13 +4634,13 @@ ...@@ -4448,13 +4634,13 @@
"_name": "up", "_name": "up",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 84 "__id__": 88
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 94 "__id__": 98
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4510,7 +4696,7 @@ ...@@ -4510,7 +4696,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 93 "__id__": 97
}, },
"_enabled": true, "_enabled": true,
"_clip": { "_clip": {
......
...@@ -118,7 +118,7 @@ cc.Class({ ...@@ -118,7 +118,7 @@ cc.Class({
getDefaultData() { getDefaultData() {
const dataJson = '{"groupArr":[{"bgItem":{"url":"http://staging-teach.cdn.ireadabc.com/c892fd494530c7ea5321f5ad8fd5171d.png","rect":{"x":302.17,"y":0,"width":1242.67,"height":699}},"hotZoneItemArr":[{"id":"1600134210418","index":0,"fontScale":1.44296875,"imgScale":1,"mapScale":1.44296875,"skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/3db1a0ed6b7e33d5f9f284e1a5980349.json","name":"Ubbie_ske.json"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/4232e00c9b1d272e650e51dbb785e498.json","name":"Ubbie_tex.json"},"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/2e56dbe3134380952a725eacceb86359.png","name":"Ubbie_tex.png"},"gIdx":"0","rect":{"x":517,"y":245.17,"width":208.65,"height":208.65}},{"id":"1600134212707","index":1,"pic_url":"http://staging-teach.cdn.ireadabc.com/92381001e3a2fb7d08920748144dba6d.png","audio_url":"http://staging-teach.cdn.ireadabc.com/1961d807c944e6551af02c7b57e117f3.mp3","itemType":"pic","fontScale":1.44296875,"imgScale":1.1417140432518729,"mapScale":1.44296875,"gIdx":"1","rect":{"x":653.56,"y":47.3,"width":175.82,"height":100.47}}],"picArr":[{"pic_url":"http://staging-teach.cdn.ireadabc.com/be8ec5cee7a3074440478b00a4a84f5e.png","audio_url":"","isRight":"1"},{"pic_url":"http://staging-teach.cdn.ireadabc.com/7404f50bbe6f8bb60a41280211e7d563.png","audio_url":"","isRight":"0"},{"pic_url":"http://staging-teach.cdn.ireadabc.com/4c49ea30ff4e7a038480614602a331e2.png","audio_url":"","isRight":"0"}],"pop_pic_url":"http://staging-teach.cdn.ireadabc.com/92381001e3a2fb7d08920748144dba6d.png","title":"I need ..","title_audio_url":"http://staging-teach.cdn.ireadabc.com/22e9facddfbf087ecdf2b60dba6019ef.mp3","skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/51e9d8e4e2e963a7658d07eba6c282f8.json","name":"Ubbie_ske.json"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/4232e00c9b1d272e650e51dbb785e498.json","name":"Ubbie_tex.json"},"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/2e56dbe3134380952a725eacceb86359.png","name":"Ubbie_tex.png"}},{"bgItem":{"url":"http://staging-teach.cdn.ireadabc.com/e15de0b2819aa341ec4424ff061917bf.png","rect":{"x":302.17,"y":0,"width":1242.67,"height":699}},"hotZoneItemArr":[{"id":"1600306712362","index":0,"fontScale":1.44296875,"imgScale":1,"mapScale":1.44296875,"skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/3db1a0ed6b7e33d5f9f284e1a5980349.json","name":"Ubbie_ske.json"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/4232e00c9b1d272e650e51dbb785e498.json","name":"Ubbie_tex.json"},"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/2e56dbe3134380952a725eacceb86359.png","name":"Ubbie_tex.png"},"gIdx":"0","rect":{"x":523.16,"y":251.33,"width":196.35,"height":196.35}},{"id":"1600306713123","index":1,"pic_url":"http://staging-teach.cdn.ireadabc.com/1e6968ec44a3ce922120109adc3260b9.png","audio_url":"http://staging-teach.cdn.ireadabc.com/0128a59057e63c4c6b4b96556d077a98.mp3","itemType":"pic","fontScale":1.44296875,"imgScale":2.6666666666666665,"mapScale":1.44296875,"gIdx":"1","rect":{"x":745.39,"y":3.23,"width":176,"height":184}}],"picArr":[{"pic_url":"http://staging-teach.cdn.ireadabc.com/c8abf7383d65bcbdba8f390785cece60.png","audio_url":"http://staging-teach.cdn.ireadabc.com/83513f8d6083ebe072e3f9e47a21558a.mp3","isRight":"1"},{"pic_url":"http://staging-teach.cdn.ireadabc.com/f6f4bbef497409fef3c8f1d375893829.png","audio_url":"http://staging-teach.cdn.ireadabc.com/5285e1e88a26a08783757e9c43a8653f.mp3","isRight":"0"},{"pic_url":"http://staging-teach.cdn.ireadabc.com/7b18a7931d64f7b9e8b7ecd25cb5e3d4.png","audio_url":"http://staging-teach.cdn.ireadabc.com/440cf9d57752b30691d90ed565e8c924.mp3","isRight":"0"},{"pic_url":"http://staging-teach.cdn.ireadabc.com/8e21a700c4d00930e8c05082a9a70c83.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/a5fa20e0c6024421b0d9a7007c303503.mp3","isRight":"0"},{"pic_url":"http://staging-teach.cdn.ireadabc.com/bf3650b10ffe365ccaac59a8b3983244.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/a41f0f2bf190396e2641ec8dada8edfe.mp3","isRight":"0"}],"skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/51e9d8e4e2e963a7658d07eba6c282f8.json","name":"Ubbie_ske.json"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/4232e00c9b1d272e650e51dbb785e498.json","name":"Ubbie_tex.json"},"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/2e56dbe3134380952a725eacceb86359.png","name":"Ubbie_tex.png"},"title":"I want ..","title_audio_url":"http://staging-teach.cdn.ireadabc.com/694a80e21cefd6e53880d61e684e1c94.mp3","pop_pic_url":"http://staging-teach.cdn.ireadabc.com/35d3ec81cdf2cfe73c6010d668c36c83.png"}]}' const dataJson = '{"groupArr":[{"bgItem":{"url":"http://staging-teach.cdn.ireadabc.com/c892fd494530c7ea5321f5ad8fd5171d.png","rect":{"x":302.17,"y":0,"width":1242.67,"height":699}},"hotZoneItemArr":[{"id":"1600134210418","index":0,"fontScale":1.44296875,"imgScale":1,"mapScale":1.44296875,"skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/3db1a0ed6b7e33d5f9f284e1a5980349.json","name":"Ubbie_ske.json"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/4232e00c9b1d272e650e51dbb785e498.json","name":"Ubbie_tex.json"},"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/2e56dbe3134380952a725eacceb86359.png","name":"Ubbie_tex.png"},"gIdx":"0","rect":{"x":517,"y":245.17,"width":208.65,"height":208.65}},{"id":"1600134212707","index":1,"pic_url":"http://staging-teach.cdn.ireadabc.com/92381001e3a2fb7d08920748144dba6d.png","audio_url":"http://staging-teach.cdn.ireadabc.com/1961d807c944e6551af02c7b57e117f3.mp3","itemType":"pic","fontScale":1.44296875,"imgScale":1.1417140432518729,"mapScale":1.44296875,"gIdx":"1","rect":{"x":653.56,"y":47.3,"width":175.82,"height":100.47}}],"picArr":[{"pic_url":"http://staging-teach.cdn.ireadabc.com/be8ec5cee7a3074440478b00a4a84f5e.png","audio_url":"http://staging-teach.cdn.ireadabc.com/f51e3fedc88aa69a99f6ef579f7de047.mp3","isRight":"1"},{"pic_url":"http://staging-teach.cdn.ireadabc.com/7404f50bbe6f8bb60a41280211e7d563.png","audio_url":"http://staging-teach.cdn.ireadabc.com/fbe2f23b9eb191a9330f99800e0d54d5.mp3","isRight":"0"},{"pic_url":"http://staging-teach.cdn.ireadabc.com/4c49ea30ff4e7a038480614602a331e2.png","audio_url":"http://staging-teach.cdn.ireadabc.com/cf5077b8cbcaa1dc664df569d4af6043.mp3","isRight":"0"}],"pop_pic_url":"http://staging-teach.cdn.ireadabc.com/92381001e3a2fb7d08920748144dba6d.png","title":"I need ..","title_audio_url":"http://staging-teach.cdn.ireadabc.com/22e9facddfbf087ecdf2b60dba6019ef.mp3","skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/51e9d8e4e2e963a7658d07eba6c282f8.json","name":"Ubbie_ske.json"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/4232e00c9b1d272e650e51dbb785e498.json","name":"Ubbie_tex.json"},"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/2e56dbe3134380952a725eacceb86359.png","name":"Ubbie_tex.png"},"bubble_audio_url":"http://staging-teach.cdn.ireadabc.com/0be0ec35fa203e84e4d955f8c32d26bb.mp3"},{"bgItem":{"url":"http://staging-teach.cdn.ireadabc.com/e15de0b2819aa341ec4424ff061917bf.png","rect":{"x":302.17,"y":0,"width":1242.67,"height":699}},"hotZoneItemArr":[{"id":"1600306712362","index":0,"fontScale":1.44296875,"imgScale":1,"mapScale":1.44296875,"skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/3db1a0ed6b7e33d5f9f284e1a5980349.json","name":"Ubbie_ske.json"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/4232e00c9b1d272e650e51dbb785e498.json","name":"Ubbie_tex.json"},"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/2e56dbe3134380952a725eacceb86359.png","name":"Ubbie_tex.png"},"gIdx":"0","rect":{"x":523.16,"y":251.33,"width":196.35,"height":196.35}},{"id":"1600306713123","index":1,"pic_url":"http://staging-teach.cdn.ireadabc.com/1e6968ec44a3ce922120109adc3260b9.png","audio_url":"http://staging-teach.cdn.ireadabc.com/0128a59057e63c4c6b4b96556d077a98.mp3","itemType":"pic","fontScale":1.44296875,"imgScale":2.6666666666666665,"mapScale":1.44296875,"gIdx":"1","rect":{"x":745.39,"y":3.23,"width":176,"height":184}}],"picArr":[{"pic_url":"http://staging-teach.cdn.ireadabc.com/c8abf7383d65bcbdba8f390785cece60.png","audio_url":"http://staging-teach.cdn.ireadabc.com/83513f8d6083ebe072e3f9e47a21558a.mp3","isRight":"1"},{"pic_url":"http://staging-teach.cdn.ireadabc.com/f6f4bbef497409fef3c8f1d375893829.png","audio_url":"http://staging-teach.cdn.ireadabc.com/5285e1e88a26a08783757e9c43a8653f.mp3","isRight":"0"},{"pic_url":"http://staging-teach.cdn.ireadabc.com/7b18a7931d64f7b9e8b7ecd25cb5e3d4.png","audio_url":"http://staging-teach.cdn.ireadabc.com/440cf9d57752b30691d90ed565e8c924.mp3","isRight":"0"},{"pic_url":"http://staging-teach.cdn.ireadabc.com/8e21a700c4d00930e8c05082a9a70c83.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/a5fa20e0c6024421b0d9a7007c303503.mp3","isRight":"0"},{"pic_url":"http://staging-teach.cdn.ireadabc.com/bf3650b10ffe365ccaac59a8b3983244.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/a41f0f2bf190396e2641ec8dada8edfe.mp3","isRight":"0"}],"skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/51e9d8e4e2e963a7658d07eba6c282f8.json","name":"Ubbie_ske.json"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/4232e00c9b1d272e650e51dbb785e498.json","name":"Ubbie_tex.json"},"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/2e56dbe3134380952a725eacceb86359.png","name":"Ubbie_tex.png"},"title":"I want ..","title_audio_url":"http://staging-teach.cdn.ireadabc.com/694a80e21cefd6e53880d61e684e1c94.mp3","pop_pic_url":"http://staging-teach.cdn.ireadabc.com/35d3ec81cdf2cfe73c6010d668c36c83.png"}]}'
const data1 = JSON.parse(dataJson); const data1 = JSON.parse(dataJson);
return data1; return data1;
}, },
...@@ -392,8 +392,15 @@ cc.Class({ ...@@ -392,8 +392,15 @@ cc.Class({
} }
const touchSound = () => { const touchSound = () => {
playAudioByUrl(circlePosNode.data.audio_url); if (circlePosNode.data.audio_url) {
this.showSoundAnima(sound);
} }
playAudioByUrl(circlePosNode.data.audio_url, () => {
this.stopSoundAnima(sound);
});
}
circle.on(cc.Node.EventType.TOUCH_START, touchCircle) circle.on(cc.Node.EventType.TOUCH_START, touchCircle)
circle.isAddTouch = true; circle.isAddTouch = true;
...@@ -401,6 +408,13 @@ cc.Class({ ...@@ -401,6 +408,13 @@ cc.Class({
const sound = circlePosNode.getChildByName('sound'); const sound = circlePosNode.getChildByName('sound');
sound.on(cc.Node.EventType.TOUCH_START, touchSound) sound.on(cc.Node.EventType.TOUCH_START, touchSound)
sound.isAddTouch = true; sound.isAddTouch = true;
const sprNode2 = this.getSprNode('icon_sound_2');
sprNode2.parent = sound.parent;
sprNode2.x = sound.x;
sprNode2.y = sound.y;
sprNode2.opacity = 0;
sound.spr2 = sprNode2;
}, },
showCircleWrong(circle) { showCircleWrong(circle) {
...@@ -453,7 +467,7 @@ cc.Class({ ...@@ -453,7 +467,7 @@ cc.Class({
animaUp() { animaUp() {
const animaNode = this.stake.animaNode const animaNode = this.stake.animaNode
const targetP = animaNode.parent.convertToNodeSpaceAR(cc.v2(0, cc.winSize.width)); const targetP = animaNode.parent.convertToNodeSpaceAR(cc.v2(0, cc.winSize.height * 1.5));
cc.tween(animaNode) cc.tween(animaNode)
.to(0.3, {y: targetP.y}) .to(0.3, {y: targetP.y})
.delay(0.2) .delay(0.2)
...@@ -468,7 +482,7 @@ cc.Class({ ...@@ -468,7 +482,7 @@ cc.Class({
const animaNode = this.hotZoneBg.animaNode; const animaNode = this.hotZoneBg.animaNode;
animaNode.active = true; animaNode.active = true;
const targetP = animaNode.parent.convertToNodeSpaceAR(cc.v2(0, cc.winSize.width)); const targetP = animaNode.parent.convertToNodeSpaceAR(cc.v2(0, cc.winSize.height * 1.5));
animaNode.y = targetP.y; animaNode.y = targetP.y;
cc.tween(animaNode) cc.tween(animaNode)
...@@ -478,6 +492,7 @@ cc.Class({ ...@@ -478,6 +492,7 @@ cc.Class({
this.bubbleJump(this.rightBubble); this.bubbleJump(this.rightBubble);
this.curRightDragonDisplay.playAnimation(this.curRightDragonDisplay.curName, -1); this.curRightDragonDisplay.playAnimation(this.curRightDragonDisplay.curName, -1);
this.curRightDragonDisplay.timeScale = 1;
this.showRightBubbleSound(); this.showRightBubbleSound();
}) })
.start(); .start();
...@@ -493,6 +508,7 @@ cc.Class({ ...@@ -493,6 +508,7 @@ cc.Class({
bubbleJump(bubble) { bubbleJump(bubble) {
bubble.active = true;
if (!bubble.baseS) { if (!bubble.baseS) {
bubble.baseS = bubble.scale; bubble.baseS = bubble.scale;
} }
...@@ -516,7 +532,22 @@ cc.Class({ ...@@ -516,7 +532,22 @@ cc.Class({
}, },
showStartAudio() { showStartAudio() {
playAudioByUrl(this.curGroup.title_audio_url); playAudioByUrl(this.curGroup.title_audio_url, () => {
this.showBubbleAudio(() => {
this.curDragonDisplay.playAnimation('normal', -1);
this.curDragonDisplay.timeScale = 1;
this.resetBubble();
});
});
},
showBubbleAudio(cb = null) {
playAudioByUrl(this.curGroup.bubble_audio_url, () => {
if (cb) {
cb();
}
});
}, },
showQuestionAudio() { showQuestionAudio() {
...@@ -586,6 +617,7 @@ cc.Class({ ...@@ -586,6 +617,7 @@ cc.Class({
spr.node.y = 376 + spr.node.height / 2 - 40; spr.node.y = 376 + spr.node.height / 2 - 40;
this.bubble = spr.node; this.bubble = spr.node;
this.bubbleJump(this.bubble); this.bubbleJump(this.bubble);
this.bubble.active = false;
}); });
}, },
...@@ -629,67 +661,6 @@ cc.Class({ ...@@ -629,67 +661,6 @@ cc.Class({
}); });
}, },
centerPart2: null,
initCenterPart2Old() {
const centerPart = cc.find('Canvas/centerPart_2');
centerPart.scale = this._mapScaleMin;
const bg = cc.find('Canvas/centerPart_2/bg');
bg.anchorY = 0;
bg.y = -cc.winSize.height/2;
bg.scale = 1 / centerPart.scale * this._mapScaleMax;
const button = cc.find('Canvas/centerPart_2/button')
const labelNode = new cc.Node('label');
labelNode.parent = button;
const label = labelNode.addComponent(cc.RichText);
const size = 48
label.string = `<size=${size}><color=#8b53da>${this.curGroup.anima_text }</color></size>`
label.font = cc.find('Canvas/res/font/FatMarker').getComponent(cc.Label).font;
labelNode.x = -10;
labelNode.addComponent(cc.Button)
btnClickAnima(labelNode);
const maxW = button.width * 0.9;
if (labelNode.width > maxW) {
labelNode.scale = maxW / labelNode.width;
}
centerPart.y = cc.winSize.height * 1;
this.centerPart2 = centerPart;
this.setStakeAnima(this.curGroup);
},
initCenterPart1() {
const centerPart = cc.find('Canvas/centerPart');
centerPart.active = true;
centerPart.scale = this._mapScaleMin;
this.initFrame();
this.initCircle();
},
centerPic: null,
initFrame() {
const picNode = cc.find('Canvas/frame/pic');
picNode.active = true;
picNode.opacity = 255;
const spr = picNode.getComponent(cc.Sprite)
const maxW = 797;
const maxH = 430;
this.getSpriteFrimeByUrl(this.curGroup.bgItem.url, (sf) => {
spr.spriteFrame = sf;
// picNode.scaleX = maxW / picNode.width;
// picNode.scaleY = maxH / picNode.height;
setSprNodeMaxLen(picNode, maxW, maxH);
})
this.centerPic = picNode;
},
getSpriteFrimeByUrl(url, cb) { getSpriteFrimeByUrl(url, cb) {
cc.loader.load({url}, (err, img) => { cc.loader.load({url}, (err, img) => {
...@@ -700,288 +671,37 @@ cc.Class({ ...@@ -700,288 +671,37 @@ cc.Class({
}) })
}, },
initCircle() {
this.addCirclePic(); showSoundAnima(iconNode, time = 0.4) {
this.addCircleSound();
},
rightData: null, iconNode.isRunAnima = true;
circleArr: null, iconNode.spr2.opacity = 255;
addCirclePic() { iconNode.opacity = 0;
const circleArr = this.getCircleArr();
this.circleArr = circleArr;
const picArr = this.curGroup.picArr;
circleArr.forEach((item, i) => {
const data = picArr[i];
if (data) {
this.getSprNodeByUrl(data.pic_url, (spr) => {
if (!item.blackMask) {
const blackMaskNode = this.getSprNode('mask')
blackMaskNode.parent = item;
blackMaskNode.scale = 1.07;
blackMaskNode.x = -2.5;
blackMaskNode.y = 3;
if (this.curGroup.picArr.length > 5) {
blackMaskNode.scale = 0.85;
blackMaskNode.x = -2.5;
blackMaskNode.y = 3;
}
blackMaskNode.zIndex = 1;
item.blackMask = blackMaskNode;
}
item.blackMask.active = false;
if (!item.blackMask.icon) {
const icon = this.getSprNode('circle_x');
icon.parent = item.blackMask;
item.blackMask.icon = icon;
}
item.blackMask.icon.scale = 0;
if (!item.maskNode) {
let maskNode = new cc.Node(); // new cc.Node();
maskNode.parent = item;
// const mask = maskNode.addComponent(cc.Mask);
// mask.type = cc.Mask.Type.IMAGE_STENCIL;
// mask.alphaThreshold = 0.1;
// mask.spriteFrame = blackMaskNode.getComponent(cc.Sprite).spriteFrame
// mask.inverted = true;
if (item.getChildByName('mask')) {
maskNode = item.getChildByName('mask');
maskNode.scale = 1.07;
maskNode.x = -2.5;
maskNode.y = 3;
if (this.curGroup.picArr.length > 5) {
maskNode.scale = 0.85;
maskNode.x = -2.5;
maskNode.y = 3;
}
const mask = maskNode.getComponent(cc.Mask);
mask.inverted = false;
}
item.maskNode = maskNode
}
const maskNode = item.maskNode;
if (item.pic) {
item.pic.removeFromParent();
}
spr.node.parent = maskNode;
setSprNodeMaxLen(spr.node, item.width * 0.8, item.height * 0.8);
item.pic = spr.node;
spr.node.addComponent(cc.Button); cc.tween(iconNode)
spr.node.on('click', () => { .delay(time / 2)
if (!this._cantouch) {
return;
}
console.log('data: ', data);
if (data.isRight == '1') {
this.showRightCircle(item);
this.rightData = data;
this._cantouch = false;
} else {
this.showWrongCircle(item);
}
});
})
}
});
},
showRightCircle(circle) {
cc.audioEngine.play(this.audioRight.clip, false, 0.3)
const picNode = circle.pic;
const oldParent = picNode.parent;
const worldPos = oldParent.convertToWorldSpaceAR(cc.v2(picNode.x, picNode.y));
const localPos = this.centerPic.parent.convertToNodeSpaceAR(cc.v2(worldPos.x, worldPos.y));
picNode.parent = this.centerPic.parent;
picNode.x = localPos.x;
picNode.y = localPos.y;
const sx = this.centerPic.width / picNode.width
const sy = this.centerPic.height / picNode.height;
const s = Math.min(sx, sy);
cc.tween(picNode)
.to(0.7, {scale: s}, {easing: 'cubicOut'})
.start();
cc.tween(picNode)
.to(0.7, {x: this.centerPic.x, y: this.centerPic.y, rotation: 360}, {easing: 'sineOut'})
.delay(0.2)
.to(0.7, {scale: 0, opacity: 0}, {easing: 'cubicIn'})
.call(() => { .call(() => {
this.changeCenterPic(); iconNode.spr2.opacity = 0;
iconNode.opacity = 255;
}) })
.start(); .delay(time / 2)
},
changeCenterPic() {
const pic = this.centerPic.pic2;
pic.active = true;
pic.opacity = 0;
cc.tween(pic)
.to(0.7, {opacity: 255}, {easing: 'cubicOut'})
.call(() => {
cc.tween(this.centerPic)
.to(0.7, {opacity: 0})
.start();
})
.delay(0.7)
.call(() => {
this.showCenterPart2();
})
.start();
},
showCenterPart2() {
cc.audioEngine.play(this.audioAppear.clip, false, 0.1)
this.centerPart2.active = true;
const frame = this.centerPart2.getChildByName('frame');
frame.scale = 0;
const button = this.centerPart2.getChildByName('button');
button.active = false;
button.baseY = button.y;
button.y = -cc.winSize.height / 2 - button.height;
const label = button.getChildByName('label');
label.opacity = 0;
cc.tween(this.centerPart2)
.to(1, {y: 0}, {easing: 'cubicIn'})
.call(() => {
cc.tween(frame)
.to(0.8, {scale: 1}, {easing: 'cubicOut'})
.start()
})
.delay(0.5)
.call(() => { .call(() => {
cc.audioEngine.play(this.audioEnter.clip, false, 0.1) if (iconNode.isRunAnima) {
button.active = true; this.showSoundAnima(iconNode);
cc.tween(button)
.to(0.3, {y: button.baseY}, {easing: 'cubicOut'})
.start()
})
.delay(0.3)
.call(() => {
this._cantouch = true;
this.showDragonAnima();
console.log('rightData: ', this.rightData);
playAudioByUrl(this.rightData.audio_url);
cc.tween(label)
.to(1, {opacity: 255}, {easing: 'sineInOut'})
.start()
})
.start();
},
showWrongCircle(circle) {
if (circle.blackMask.active) {
return;
}
circle.blackMask.active = true;
cc.audioEngine.play(this.audioWrong.clip, false, 0.2)
const showIcon = () => {
cc.tween(circle.blackMask.icon)
.to(0.3, {scale: 0.9}, {easing: 'bounceOut'})
.delay(0.2)
.to(0.7, {scale: 0}, {easing: 'cubicIn'})
.start();
} }
const hide = () => {
circle.blackMask.opacity = 0;
cc.tween(circle.blackMask)
.to(0.1, {opacity: 255})
.call(() => {
showIcon();
}) })
.start() .start()
}
hide();
circle.blackMask.active = true;
}, },
stopSoundAnima(iconNode) {
addCircleSound() { iconNode.isRunAnima = false;
this.circleArr.forEach(item => {
const sprNode = this.getSprNode('icon_sound');
sprNode.parent = item;
sprNode.x = item.width / 2.8;
sprNode.y = item.height / 2.8;
sprNode.zIndex = 2;
sprNode.addComponent(cc.Button)
sprNode.on('click', () => {
playAudioByUrl( item.data.audio_url );
});
});
}, },
getCircleArr() {
const picArr = this.curGroup.picArr;
const circleArr = [];
let node, circleNum = 0;
console.log('picArr: ', picArr);
const node3_5 = cc.find('Canvas/centerPart/pos_3_5');
const node6_8 = cc.find('Canvas/centerPart/pos_6_8');
if (picArr.length <= 5) {
node3_5.active = true;
node6_8.active = false;
node = node3_5;
circleNum = 5;
} else {
node3_5.active = false;
node6_8.active = true;
node = node6_8;
circleNum = 8;
}
for (let i = 0; i < circleNum; i++) {
let circleNode = node.getChildByName((i + 1).toString());
if (picArr[i]) {
circleNode.active = true;
circleNode.data = picArr[i];
circleArr.push(circleNode);
} else {
circleNode.active = false;
}
}
return circleArr;
},
initBottomPart() { initBottomPart() {
const bottomPart = cc.find('Canvas/bottomPart') const bottomPart = cc.find('Canvas/bottomPart')
...@@ -1113,6 +833,11 @@ cc.Class({ ...@@ -1113,6 +833,11 @@ cc.Class({
this.hideMaskLayer(() => { this.hideMaskLayer(() => {
this.isShowRightAnima = false; this.isShowRightAnima = false;
this._cantouch = true; this._cantouch = true;
this.showBubbleAudio(() => {
this.curDragonDisplay.playAnimation('normal', -1);
this.curDragonDisplay.timeScale = 1;
this.resetBubble();
});
// this.showQuestionAudio(); // this.showQuestionAudio();
}); });
}) })
...@@ -1164,52 +889,6 @@ cc.Class({ ...@@ -1164,52 +889,6 @@ cc.Class({
} }
}, },
initCenterPart2() {
const centerPart = cc.find('Canvas/centerPart_2');
centerPart.scale = this._mapScaleMin;
centerPart.active = false;
const bg = cc.find('Canvas/centerPart_2/bg');
bg.anchorY = 0;
bg.y = -cc.winSize.height/2;
bg.scale = 1 / centerPart.scale * this._mapScaleMax;
const button = cc.find('Canvas/centerPart_2/button')
if (!button.labelNode) {
const labelNode = new cc.Node('label');
labelNode.parent = button;
labelNode.addComponent(cc.RichText);
labelNode.x = -10;
labelNode.addComponent(cc.Button)
labelNode.on('click', () => {
playAudioByUrl(this.curGroup.anima_audio_url);
})
btnClickAnima(labelNode);
button.labelNode = labelNode;
}
const size = 48
const label = button.labelNode.getComponent(cc.RichText);
label.font = cc.find('Canvas/res/font/FatMarker').getComponent(cc.Label).font;
label.string = `<size=${size}><color=#8b53da>${this.curGroup.anima_text }</color></size>`
const maxW = button.width * 0.9;
if (button.labelNode.width > maxW) {
labelNode.scale = maxW / button.labelNode.width;
}
centerPart.y = cc.winSize.height * 1;
this.centerPart2 = centerPart;
this.setStakeAnima(this.curGroup);
},
curDragonDisplay: null, curDragonDisplay: null,
setStakeAnima(data) { setStakeAnima(data) {
...@@ -1322,7 +1001,8 @@ cc.Class({ ...@@ -1322,7 +1001,8 @@ cc.Class({
// } // }
// }); // });
dragonDisplay.playAnimation('normal', -1); dragonDisplay.playAnimation('normal', 1);
dragonDisplay.timeScale = 0;
dragonDisplay.animaNames = animationNames; dragonDisplay.animaNames = animationNames;
...@@ -1485,7 +1165,8 @@ cc.Class({ ...@@ -1485,7 +1165,8 @@ cc.Class({
// } // }
if (animationNames.length > 0) { if (animationNames.length > 0) {
dragonDisplay.buildArmature(animationNames[0]) dragonDisplay.playAnimation(animationNames[0], 1);
dragonDisplay.timeScale = 0;
dragonDisplay.curName = animationNames[0]; dragonDisplay.curName = animationNames[0];
// dragonDisplay.playAnimation(animationNames[0], -1); // dragonDisplay.playAnimation(animationNames[0], -1);
// dragonDisplay.playAnimation(animationNames[0], -1); // dragonDisplay.playAnimation(animationNames[0], -1);
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 61, "height": 61,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"circle_sound": { "icon_sound": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "5faab788-0d86-4511-998e-48214a855fbb", "uuid": "5faab788-0d86-4511-998e-48214a855fbb",
"rawTextureUuid": "413a63b7-640b-4d7f-a519-e6bf78322009", "rawTextureUuid": "413a63b7-640b-4d7f-a519-e6bf78322009",
......
{
"ver": "2.3.5",
"uuid": "da978bd4-4537-4012-88d8-214d4ad0b9ab",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 57,
"height": 61,
"platformSettings": {},
"subMetas": {
"icon_sound_2": {
"ver": "1.0.4",
"uuid": "53463ad2-6c62-4530-91bd-d4ad29e1528d",
"rawTextureUuid": "da978bd4-4537-4012-88d8-214d4ad0b9ab",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 57,
"height": 61,
"rawWidth": 57,
"rawHeight": 61,
"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