Commit bd1ac5d6 authored by asdf's avatar asdf

.

parent 9900f36b
{
"ver": "2.0.1",
"uuid": "61bb3c5a-7125-4710-aa40-7fb3d9feb3d1",
"downloadMode": 0,
"duration": 0.216,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "509a0fa6-1734-4386-815d-3d518bb1cf8f",
"downloadMode": 0,
"duration": 1.854694,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "69c6499a-e0df-47b5-a5df-20a5f3272254",
"downloadMode": 0,
"duration": 1.044898,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "f87f553d-42df-42cc-98df-264b0752357f",
"downloadMode": 0,
"duration": 1.393083,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "8ab43197-f011-4f59-9341-71def648e29c",
"downloadMode": 0,
"duration": 3.787755,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "5ae1822d-008f-4fda-994c-7e44bc02a4a1",
"subMetas": {}
}
\ No newline at end of file
......@@ -217,7 +217,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 26.62,
"width": 0,
"height": 100.8
},
"_anchorPoint": {
......@@ -270,8 +270,8 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_useOriginalSize": false,
"_string": "j",
"_N$string": "j",
"_string": "",
"_N$string": "",
"_fontSize": 66,
"_lineHeight": 80,
"_enableWrapText": true,
......@@ -312,6 +312,9 @@
"labWord": {
"__id__": 6
},
"audDrop": {
"__uuid__": "61bb3c5a-7125-4710-aa40-7fb3d9feb3d1"
},
"_id": ""
},
{
......
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
"_name": "LayerOver",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 6
},
{
"__id__": 9
}
],
"_active": true,
"_components": [
{
"__id__": 23
},
{
"__id__": 24
},
{
"__id__": 25
},
{
"__id__": 26
}
],
"_prefab": {
"__id__": 27
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
640,
360,
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": ""
},
{
"__type__": "cc.Node",
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
},
{
"__id__": 4
}
],
"_prefab": {
"__id__": 5
},
"_opacity": 0,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_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": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1280,
"_originalHeight": 720,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "08943eff-5fc8-47e9-bf14-8f95396918a9"
},
"fileId": "2fBzmee0hC0KA/5EhZ4RR0",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "bg_verygood",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 7
}
],
"_prefab": {
"__id__": 8
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 831,
"height": 147
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
0,
0,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "08943eff-5fc8-47e9-bf14-8f95396918a9"
},
"fileId": "65IPSoGe5CkY73zbJsSVmx",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "RibbonNodeBase",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 10
},
{
"__id__": 13
},
{
"__id__": 16
},
{
"__id__": 19
}
],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 22
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
2466.904,
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": ""
},
{
"__type__": "cc.Node",
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 9
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 11
}
],
"_prefab": {
"__id__": 12
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 251,
"g": 197,
"b": 13,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 36,
"height": 24
},
"_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": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "7306b5ce-b40a-40ca-aa2c-c9d2689516c8"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "08943eff-5fc8-47e9-bf14-8f95396918a9"
},
"fileId": "43lgj4QY5Fka/qLQewjvRL",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 9
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 14
}
],
"_prefab": {
"__id__": 15
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 82,
"b": 82,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 36,
"height": 24
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-53,
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": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "7306b5ce-b40a-40ca-aa2c-c9d2689516c8"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "08943eff-5fc8-47e9-bf14-8f95396918a9"
},
"fileId": "a9O3LCvuFMoo9ESpNOLc1F",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 9
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 17
}
],
"_prefab": {
"__id__": 18
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 83,
"g": 212,
"b": 244,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 36,
"height": 24
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-106,
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": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 16
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "7306b5ce-b40a-40ca-aa2c-c9d2689516c8"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "08943eff-5fc8-47e9-bf14-8f95396918a9"
},
"fileId": "48s90A1VxCwaaaXM6NGQzB",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 9
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 20
}
],
"_prefab": {
"__id__": 21
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 157,
"g": 250,
"b": 36,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 36,
"height": 24
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-159,
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": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 19
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "7306b5ce-b40a-40ca-aa2c-c9d2689516c8"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "08943eff-5fc8-47e9-bf14-8f95396918a9"
},
"fileId": "f9cQCu/0RNN6mlrehZ5p8C",
"sync": false
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "08943eff-5fc8-47e9-bf14-8f95396918a9"
},
"fileId": "1bPYo6EbpKnbsdPb1e3nE0",
"sync": false
},
{
"__type__": "e22e11e0CVGPajfhd4ljXke",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"FitType": 1,
"_id": ""
},
{
"__type__": "538f49F3K1K6IBNqrzfrpzu",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"audOver": {
"__uuid__": "8ab43197-f011-4f59-9341-71def648e29c"
},
"audOver2": null,
"_id": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1280,
"_originalHeight": 720,
"_id": ""
},
{
"__type__": "cc.Animation",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_defaultClip": null,
"_clips": [],
"playOnLoad": true,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "08943eff-5fc8-47e9-bf14-8f95396918a9"
},
"fileId": "7clMl2GbFKqphcx/dFidIz",
"sync": false
}
]
\ No newline at end of file
{
"ver": "1.2.7",
"uuid": "08943eff-5fc8-47e9-bf14-8f95396918a9",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
......@@ -2754,7 +2754,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 288.95,
"width": 0,
"height": 50.4
},
"_anchorPoint": {
......@@ -3562,6 +3562,9 @@
"pfbItemCollisionEffect": {
"__uuid__": "dc01f23a-4f76-4fc8-9793-1c29e3774b79"
},
"layerOver": {
"__uuid__": "08943eff-5fc8-47e9-bf14-8f95396918a9"
},
"spfAudio": [
{
"__uuid__": "621af077-00ed-4f70-b28d-614b433de24d"
......@@ -3589,6 +3592,18 @@
"__uuid__": "6d54e77c-2b6b-45a3-b4ae-1aa53f84531b"
}
],
"audEnter": {
"__uuid__": "509a0fa6-1734-4386-815d-3d518bb1cf8f"
},
"audReplay": {
"__uuid__": "f87f553d-42df-42cc-98df-264b0752357f"
},
"audWelldone": {
"__uuid__": "8ab43197-f011-4f59-9341-71def648e29c"
},
"audGoodjob": {
"__uuid__": "69c6499a-e0df-47b5-a5df-20a5f3272254"
},
"_id": "76pKAVQpBDVby2iIHB3LLz"
}
]
\ No newline at end of file
......@@ -5,6 +5,7 @@ cc.Class({
properties: {
labWord: cc.Label,
audDrop:cc.AudioClip,
},
onLoad() {
......@@ -107,9 +108,18 @@ cc.Class({
EventMgr.emit('onTouchmove', { x: delta.x, index: itemList[0].index });
}
},
playAudioDrop() {
GameData.audioCount++;
let id = cc.audioEngine.play(this.audDrop, false, 1);
cc.audioEngine.setFinishCallback(id, () => {
GameData.audioCount--;
})
},
onTouchEnd() {
if (!this.hadMove) {
this.playAudio();
}else{
this.playAudioDrop();
}
this.hadMove = false;
this.isActive = false;
......
......@@ -5,7 +5,6 @@ cc.Class({
properties: {
audOver: cc.AudioClip,
audOver2: cc.AudioClip,
},
// LIFE-CYCLE CALLBACKS:
......@@ -15,24 +14,21 @@ cc.Class({
},
start() {
this.scheduleOnce(() => {
showFireworks(
this.node,
this.node.getChildByName('RibbonNodeBase').children,
cc.v2(0, -400), cc.v2(0, 1000), 200, 200
);
showFireworks(
this.node,
this.node.getChildByName('RibbonNodeBase').children,
cc.v2(-600, -400), cc.v2(200, 1000), 200, 200
);
showFireworks(
this.node,
this.node.getChildByName('RibbonNodeBase').children,
cc.v2(600, -400), cc.v2(-200, 1000), 200, 200
);
this.playAudioOver2();
}, 0.6)
showFireworks(
this.node,
this.node.getChildByName('RibbonNodeBase').children,
cc.v2(0, -400), cc.v2(0, 1000), 200, 200
);
showFireworks(
this.node,
this.node.getChildByName('RibbonNodeBase').children,
cc.v2(-600, -400), cc.v2(200, 1000), 200, 200
);
showFireworks(
this.node,
this.node.getChildByName('RibbonNodeBase').children,
cc.v2(600, -400), cc.v2(-200, 1000), 200, 200
);
this.playAudioOver();
},
......@@ -43,12 +39,6 @@ cc.Class({
GameData.audioCount--;
})
},
playAudioOver2() {
GameData.audioCount++;
let id = cc.audioEngine.play(this.audOver2, false, 1);
cc.audioEngine.setFinishCallback(id, () => {
GameData.audioCount--;
})
},
// update (dt) {},
});
......@@ -10,9 +10,14 @@ cc.Class({
pfbItem: cc.Prefab,
pfbItemWord: cc.Prefab,
pfbItemCollisionEffect: cc.Prefab,
layerOver: cc.Prefab,
spfAudio: [cc.SpriteFrame],
spfLeft: [cc.SpriteFrame],
spfRight: [cc.SpriteFrame],
audEnter: cc.AudioClip,
audReplay: cc.AudioClip,
audWelldone: cc.AudioClip,
audGoodjob: cc.AudioClip,
},
// 生命周期 onLoad
......@@ -111,6 +116,10 @@ cc.Class({
return;
}
GameData.questionIndex = 0;
this.questionList = [];
for (let i = 0; i < this.data.questionList.length; i++) {
this.questionList.push(i);
}
this.initData();
this.updateBtnStatus();
......@@ -129,7 +138,7 @@ cc.Class({
},
startGame() {
this.playAudioEnter();
},
initTitle() {
......@@ -171,6 +180,14 @@ cc.Class({
})
},
playAudioEnter() {
GameData.audioCount++;
let id = cc.audioEngine.play(this.audEnter, false, 1);
cc.audioEngine.setFinishCallback(id, () => {
GameData.audioCount--;
})
},
updateBtnStatus() {
if (this.data.questionList.length === 1) {
this.nodeDict.btnLast.active = false;
......@@ -189,17 +206,16 @@ cc.Class({
}
},
checkOver() {
if (this.questionList.length == 0) {
return true;
}
},
checkDone(length, pos) {
if (length < this.data.questionList[GameData.questionIndex].optionList.length) {
return;
}
for (let i = 0; i < this.questionList.length; i++) {
if (this.questionList[i] === GameData.questionIndex) {
this.questionList.splice(i, 1);
i--;
}
}
this.nodeDict.layerParts.destroyAllChildren();
let node = cc.instantiate(this.pfbItemWord);
node.parent = this.nodeDict.layerParts;
......@@ -216,9 +232,21 @@ cc.Class({
cc.tween(this.nodeDict.layerDone)
.to(0.25, { scale: 1.05 })
.to(0.1, { scale: 1 })
.call(() => {
this.onBtnClickAudio(() => {
this.playAudioGoodjob();
});
})
.start()
},
playAudioGoodjob() {
GameData.audioCount++;
let id = cc.audioEngine.play(this.audGoodjob, false, 1);
cc.audioEngine.setFinishCallback(id, () => {
GameData.audioCount--;
this.checkOver();
})
},
resetDate() {
this.nodeDict.layerDone.active = false;
cc.audioEngine.stopAll();
......@@ -237,6 +265,7 @@ cc.Class({
return;
}
this.resetDate();
this.playAudioReplay();
},
onTurnNext() {
if (GameData.audioCount != 0) {
......@@ -253,14 +282,14 @@ cc.Class({
}
this.playAudio()
} else if (button.node.name == 'btnLast') {
if(this.nodeDict.btnLast.getComponent(cc.Sprite).spriteFrame === this.spfLeft[0]){
if (this.nodeDict.btnLast.getComponent(cc.Sprite).spriteFrame === this.spfLeft[0]) {
return;
}
this.onTurnLast();
} else if (button.node.name == 'btnReplay') {
this.onReplay();
} else if (button.node.name == 'btnNext') {
if(this.nodeDict.btnNext.getComponent(cc.Sprite).spriteFrame === this.spfRight[0]){
if (this.nodeDict.btnNext.getComponent(cc.Sprite).spriteFrame === this.spfRight[0]) {
return;
}
this.onTurnNext();
......@@ -268,19 +297,24 @@ cc.Class({
this.onBtnClickAudio();
}
},
playAudioReplay() {
GameData.audioCount++;
let id = cc.audioEngine.play(this.audReplay, false, 1);
cc.audioEngine.setFinishCallback(id, () => {
GameData.audioCount--;
})
},
changeAudioSpfCb() {
this.sprAudio.spriteFrame = this.spfAudio[this.audioSpfIndex];
this.audioSpfIndex++;
this.audioSpfIndex = this.audioSpfIndex % 3;
},
onBtnClickAudio() {
if (GameData.audioCount > 0) {
return;
}
onBtnClickAudio(cb) {
this.sprAudio.spriteFrame = this.spfAudio[0];
this.unschedule(this.changeAudioSpfCb)
this.schedule(this.changeAudioSpfCb, 0.2)
this.playAudio(() => {
cb && cb();
this.unschedule(this.changeAudioSpfCb)
this.sprAudio.spriteFrame = this.spfAudio[1];
});
......@@ -317,4 +351,20 @@ cc.Class({
}
}, 2)
},
checkOver() {
if (this.questionList.length !== 0) {
return;
}
if (this.gameOver) {
return;
}
this.gameOver = true;
this.showGameOver();
},
showGameOver() {
let node = cc.instantiate(this.layerOver);
node.parent = this.node;
},
});
{
"ver": "2.3.5",
"uuid": "8113da78-a59d-4620-a728-bbe19ebee330",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 36,
"height": 24,
"platformSettings": {},
"subMetas": {
"bg_sahua": {
"ver": "1.0.4",
"uuid": "7306b5ce-b40a-40ca-aa2c-c9d2689516c8",
"rawTextureUuid": "8113da78-a59d-4620-a728-bbe19ebee330",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 36,
"height": 24,
"rawWidth": 36,
"rawHeight": 24,
"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