Commit afc17203 authored by 杨一航's avatar 杨一航

feat: done

parent 9935700b
......@@ -23,6 +23,10 @@ export default class CakeBar extends cc.Component {
node.getChildByName("fall").active = state == 2;
node.getChildByName("in").active = state == 0;
node.getChildByName("done").active = state == 1;
if (state == 1) {
node.opacity = 0;
cc.tween(node).to(0.5, { opacity: 127, scale: 1.2 }).to(0.5, { opacity: 255, scale: 1 }).start();
}
}
......
......@@ -41,7 +41,11 @@ export default class Candle extends cc.Component {
}
setSkin(type: number) {
this.node.active = true;
this.fire.node.active = true;
this.fireEnd.node.active = false;
this.proBar.barSprite.spriteFrame = this.skin[type];
this.proBar.progress = 1;
}
fireOn(time: number, endCall) {
......
......@@ -43,12 +43,12 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 300,
"width": 34,
"height": 50
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"x": 1,
"y": 0.5
},
"_trs": {
......@@ -129,7 +129,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
17,
-17,
0,
0,
0,
......@@ -162,7 +162,7 @@
"__id__": 2
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 4
......@@ -269,7 +269,7 @@
"__id__": 2
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 7
......@@ -376,7 +376,7 @@
"__id__": 2
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 10
......@@ -528,10 +528,10 @@
"_enabled": true,
"_layoutSize": {
"__type__": "cc.Size",
"width": 300,
"width": 34,
"height": 50
},
"_resize": 0,
"_resize": 1,
"_N$layoutType": 1,
"_N$cellSize": {
"__type__": "cc.Size",
......
......@@ -78,46 +78,49 @@
"__id__": 7
},
{
"__id__": 15
"__id__": 19
},
{
"__id__": 21
"__id__": 25
},
{
"__id__": 26
"__id__": 30
},
{
"__id__": 35
"__id__": 39
},
{
"__id__": 36
"__id__": 40
},
{
"__id__": 37
"__id__": 41
},
{
"__id__": 41
"__id__": 45
},
{
"__id__": 43
"__id__": 47
},
{
"__id__": 45
"__id__": 49
},
{
"__id__": 47
"__id__": 51
},
{
"__id__": 55
}
],
"_active": true,
"_components": [
{
"__id__": 51
"__id__": 62
},
{
"__id__": 52
"__id__": 63
},
{
"__id__": 53
"__id__": 64
}
],
"_prefab": null,
......@@ -376,15 +379,18 @@
},
{
"__id__": 12
},
{
"__id__": 13
}
],
"_active": true,
"_components": [
{
"__id__": 13
"__id__": 17
},
{
"__id__": 14
"__id__": 18
}
],
"_prefab": null,
......@@ -443,7 +449,7 @@
"__id__": 7
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 9
......@@ -658,6 +664,187 @@
"groupIndex": 0,
"_id": "88aic1F49FXI4/g4cEl9+f"
},
{
"__type__": "cc.Node",
"_name": "answer",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 14
},
{
"__id__": 15
},
{
"__id__": 16
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 149,
"height": 88
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
500,
30,
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": "a9YQWmOthEqKuFYLycVrv0"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "d5d1ee58-241c-4d9a-8c7d-a550d6fd2690"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "ad2OTmmiBDkpTJTDWcfwSW"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "41T2+NU6tKrrO8MiO/a43Q"
},
{
"__type__": "38a22FB72FKLZarwAivSQnN",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"clickAudio": {
"__uuid__": "f0680ae0-c079-45ef-abd7-9e63d90b982b"
},
"_id": "2fzNGTOe5BsKzTMUiO6v9O"
},
{
"__type__": "cc.Sprite",
"_name": "",
......@@ -726,16 +913,16 @@
},
"_children": [
{
"__id__": 16
"__id__": 20
}
],
"_active": true,
"_components": [
{
"__id__": 19
"__id__": 23
},
{
"__id__": 20
"__id__": 24
}
],
"_prefab": null,
......@@ -791,16 +978,16 @@
"_name": "lb",
"_objFlags": 0,
"_parent": {
"__id__": 15
"__id__": 19
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 17
"__id__": 21
},
{
"__id__": 18
"__id__": 22
}
],
"_prefab": null,
......@@ -856,7 +1043,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 16
"__id__": 20
},
"_enabled": true,
"_materials": [
......@@ -891,7 +1078,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 16
"__id__": 20
},
"_enabled": true,
"_color": {
......@@ -909,7 +1096,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
"__id__": 19
},
"_enabled": true,
"_materials": [
......@@ -941,7 +1128,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
"__id__": 19
},
"_enabled": true,
"alignMode": 1,
......@@ -972,13 +1159,13 @@
},
"_children": [
{
"__id__": 22
"__id__": 26
}
],
"_active": false,
"_components": [
{
"__id__": 25
"__id__": 29
}
],
"_prefab": null,
......@@ -1034,16 +1221,16 @@
"_name": "lb_word",
"_objFlags": 0,
"_parent": {
"__id__": 21
"__id__": 25
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 23
"__id__": 27
},
{
"__id__": 24
"__id__": 28
}
],
"_prefab": null,
......@@ -1099,7 +1286,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
"__id__": 26
},
"_enabled": true,
"_materials": [
......@@ -1134,7 +1321,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
"__id__": 26
},
"_enabled": true,
"_color": {
......@@ -1152,7 +1339,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 21
"__id__": 25
},
"_enabled": true,
"_materials": [
......@@ -1188,13 +1375,13 @@
},
"_children": [
{
"__id__": 27
"__id__": 31
}
],
"_active": false,
"_components": [
{
"__id__": 34
"__id__": 38
}
],
"_prefab": null,
......@@ -1250,20 +1437,20 @@
"_name": "evaluation_bg",
"_objFlags": 0,
"_parent": {
"__id__": 26
"__id__": 30
},
"_children": [
{
"__id__": 28
"__id__": 32
},
{
"__id__": 29
"__id__": 33
}
],
"_active": true,
"_components": [
{
"__id__": 33
"__id__": 37
}
],
"_prefab": null,
......@@ -1319,7 +1506,7 @@
"_name": "center",
"_objFlags": 0,
"_parent": {
"__id__": 27
"__id__": 31
},
"_children": [],
"_active": true,
......@@ -1377,19 +1564,19 @@
"_name": "centerBtn",
"_objFlags": 0,
"_parent": {
"__id__": 27
"__id__": 31
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 30
"__id__": 34
},
{
"__id__": 31
"__id__": 35
},
{
"__id__": 32
"__id__": 36
}
],
"_prefab": null,
......@@ -1445,7 +1632,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 29
"__id__": 33
},
"_enabled": true,
"alignMode": 1,
......@@ -1472,7 +1659,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 29
"__id__": 33
},
"_enabled": true,
"_normalMaterial": null,
......@@ -1540,7 +1727,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 29
"__id__": 33
},
"_enabled": true,
"clickAudio": {
......@@ -1553,7 +1740,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 27
"__id__": 31
},
"_enabled": true,
"_materials": [
......@@ -1585,7 +1772,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 26
"__id__": 30
},
"_enabled": true,
"_materials": [
......@@ -1739,13 +1926,13 @@
"_active": false,
"_components": [
{
"__id__": 38
"__id__": 42
},
{
"__id__": 39
"__id__": 43
},
{
"__id__": 40
"__id__": 44
}
],
"_prefab": null,
......@@ -1801,7 +1988,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 37
"__id__": 41
},
"_enabled": true,
"_materials": [
......@@ -1833,7 +2020,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 37
"__id__": 41
},
"_enabled": true,
"_id": "01+Y/GzuFOHJLQR+96yvFP"
......@@ -1843,7 +2030,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 37
"__id__": 41
},
"_enabled": true,
"alignMode": 1,
......@@ -1876,7 +2063,7 @@
"_active": true,
"_components": [
{
"__id__": 42
"__id__": 46
}
],
"_prefab": null,
......@@ -1890,19 +2077,19 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"width": 0,
"height": 30
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"x": 1,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
490,
590,
325,
0,
0,
......@@ -1932,7 +2119,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 41
"__id__": 45
},
"_enabled": true,
"alignMode": 1,
......@@ -1965,7 +2152,7 @@
"_active": false,
"_components": [
{
"__id__": 44
"__id__": 48
}
],
"_prefab": null,
......@@ -2021,7 +2208,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 43
"__id__": 47
},
"_enabled": true,
"_materials": [
......@@ -2067,7 +2254,7 @@
"_active": false,
"_components": [
{
"__id__": 46
"__id__": 50
}
],
"_prefab": null,
......@@ -2123,7 +2310,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 45
"__id__": 49
},
"_enabled": true,
"_materials": [
......@@ -2161,13 +2348,13 @@
"_active": true,
"_components": [
{
"__id__": 48
"__id__": 52
},
{
"__id__": 49
"__id__": 53
},
{
"__id__": 50
"__id__": 54
}
],
"_prefab": null,
......@@ -2223,7 +2410,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 47
"__id__": 51
},
"_enabled": true,
"_materials": [
......@@ -2255,7 +2442,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 47
"__id__": 51
},
"_enabled": true,
"_normalMaterial": null,
......@@ -2323,7 +2510,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 47
"__id__": 51
},
"_enabled": true,
"clickAudio": {
......@@ -2331,6 +2518,364 @@
},
"_id": "89hAyk/zpNO5O7CWQX8kAj"
},
{
"__type__": "cc.Node",
"_name": "endRoot",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 56
},
{
"__id__": 58
},
{
"__id__": 60
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_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": [
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": "5bfaAyxhFEu6nRH/BP8/dT"
},
{
"__type__": "cc.Node",
"_name": "flower",
"_objFlags": 0,
"_parent": {
"__id__": 55
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 57
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1156,
"height": 652
},
"_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": "c7qe8vf+9DYL4ZnplXzSkb"
},
{
"__type__": "dragonBones.ArmatureDisplay",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 56
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_armatureName": "Armature",
"_animationName": "normal",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": 0,
"premultipliedAlpha": false,
"_armatureKey": "16fac01c-a92c-41ea-a58f-9d4e1c45c5f4#f3d4a96e-162e-4eae-b189-89c65a265ff3",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "16fac01c-a92c-41ea-a58f-9d4e1c45c5f4"
},
"_N$dragonAtlasAsset": {
"__uuid__": "f3d4a96e-162e-4eae-b189-89c65a265ff3"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 1,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "adiV7KrD5OOJ1z7Fs3X7rD"
},
{
"__type__": "cc.Node",
"_name": "nicetry",
"_objFlags": 0,
"_parent": {
"__id__": 55
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 59
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 779,
"height": 350
},
"_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": "2dvGIL/+1I15aFDSFgS745"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 58
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "9b6da2ce-b57a-4359-be31-f2650a8d70f5"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "7f7EjCiOdIDpKK23X9067m"
},
{
"__type__": "cc.Node",
"_name": "comeon",
"_objFlags": 0,
"_parent": {
"__id__": 55
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 61
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 720,
"height": 199
},
"_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": "d9ogXrX3NCiZAofMzeJUbS"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 60
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "3f321347-a19d-4bc7-afaa-72188d163811"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "256aRFvaVB1bfa6G8VoJAX"
},
{
"__type__": "cc.Canvas",
"_name": "",
......@@ -2399,49 +2944,55 @@
"__uuid__": "72e10335-6d78-426b-b387-5442c05cc4bc"
},
"cover": {
"__id__": 37
"__id__": 41
},
"title": {
"__id__": 17
"__id__": 21
},
"startNode": {
"__id__": 50
"__id__": 54
},
"audioRoot": {
"__id__": 10
},
"answerNode": {
"__id__": 16
},
"cakrBarRoot": {
"__id__": 41
"__id__": 45
},
"cakeRoot": {
"__id__": 21
"__id__": 25
},
"candleRoot": {
"__id__": 12
},
"endRoot": {
"__id__": 55
},
"tvRoot": {
"__id__": 26
"__id__": 30
},
"tvCenter": {
"__id__": 28
"__id__": 32
},
"tvCenterBtn": {
"__id__": 32
"__id__": 36
},
"excellent": {
"__id__": 44
"__id__": 48
},
"nictTry": {
"__id__": 45
"__id__": 49
},
"lb_word": {
"__id__": 23
"__id__": 27
},
"choseARoot": {
"__id__": 35
"__id__": 39
},
"choseBRoot": {
"__id__": 36
"__id__": 40
},
"cakePiece": {
"__id__": 8
......
......@@ -7,6 +7,7 @@ import ChoseNode from "../prefabs/choseNode";
import CakeBar from "../prefabs/CakeBar";
import AudioBar from "../prefabs/AudioBar";
import Candle from "../prefabs/Candle";
import { delayCall } from "../../../form_angular/src/app/play/Unit";
const { ccclass, property } = cc._decorator;
@ccclass
......@@ -40,6 +41,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
@property(cc.Node)
audioRoot: cc.Node = null
@property(AudioButton)
answerNode: AudioButton = null
@property(cc.Node)
cakrBarRoot: cc.Node = null
......@@ -49,6 +53,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
@property(cc.Node)
candleRoot: cc.Node = null
@property(cc.Node)
endRoot: cc.Node = null
@property(cc.Node)
tvRoot: cc.Node = null
@property(cc.Node)
......@@ -59,7 +66,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
@property(dragonBones.ArmatureDisplay)
excellent: dragonBones.ArmatureDisplay = null;
@property(cc.Node)
nictTry: cc.Node = null;
......@@ -92,6 +98,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
private _txtAni: cc.Node;
private _candle: Candle;
private _coursewareDone: boolean;
private _wrongQuestion: number;
......@@ -122,6 +129,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 所有全局变量 默认都是null
this._cantouch = true;
this._totalQuestion = defaultData.questions.length;
this._wrongQuestion = 0;
await new Promise((resolve) => {
cc.assetManager.loadBundle("cake_template_test", (ero) => {
......@@ -152,6 +160,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.candleRoot.active = false;
this.excellent.node.active = false;
this.nictTry.active = false;
this.answerNode.node.active = false;
}
pic1 = null;
......@@ -209,6 +218,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
initBtn() {
this.startNode.onceClick(this._startAndRemoveCover, this);
this.tvCenterBtn.onClick(this._replayAni, this);
this.answerNode.onClick(this._answerNow, this);
}
async _startAndRemoveCover() {
cc.tween(this.startNode.node).delay(0.2).hide().start();
......@@ -237,7 +247,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
this._nowData = defaultData.questions[this._questionIndex];
this._cakeBar.updateUI(this._questionIndex, 0);
this.initNodes(this._nowData);
// this.testDragonB();
......@@ -260,6 +269,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
let rightLetter: string = data.rightLetter;
let wrongLetter: string = data.wrongLetter;
this._nowRightLetter = rightLetter;
this.answerNode.node.x = cc.winSize.width
this.lb_word.string = word;
if (!this._cake) {
......@@ -300,15 +310,28 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.audioRoot.active = true;
cc.tween(this.audioRoot).to(0.5, { x: 550, y: 30 }).start();
this.setCandelBar(0)
cc.tween(this.candleRoot).to(0.5, { x: -550 }).call(() => {
this._candle.fireOn(this._nowData.choosewaitTime, this._choseTimeOut.bind(this));
this.cover.active = false;
}).start();
})
}
async _choseTimeOut() {
_choseTimeOut() {
console.log("_choseTimeOut");
if (!this._canAnswer) return;
this._canAnswer = false;
this.cakePiece.active = true;
this.setCandelBar(2);
asyncTweenTo(this.candleRoot, 0.5, { x: -cc.winSize.width })
asyncTweenTo(this.audioRoot, 0.5, { x: cc.winSize.width })
asyncTweenTo(this.choseARoot, 0.5, { x: cc.winSize.width })
await asyncTweenTo(this.choseBRoot, 0.5, { x: cc.winSize.width })
this.nextStep(false)
}
async _onClickAnswer(node, isAnswer: boolean) {
......@@ -322,21 +345,31 @@ export default class SceneComponent extends MyCocosSceneComponent {
await asyncTweenTo(node.parent, 0.3, { x: 0, y: -100 })
node.active = false;
this._cake.insert(this._nowRightLetter, this._nowRightIndex);
this._cakeBar.updateUI(this._questionIndex, 1);
await asyncDelay(3);
await asyncDelay(1);
} else {
this._candle.fireStop();
await this.playLocalAudio("effect_cake_drop", true);
await asyncTweenTo(node.parent, 0.18, { x: 200, y: -300 })
// await asyncTweenTo(node.parent, 0.18, { x: 200, y: -300 })
node.active = false;
this.cakePiece.active = true;
this._cakeBar.updateUI(this._questionIndex, 2);
await asyncDelay(3);
this.setCandelBar(2);
await asyncDelay(1);
}
this.nextStep(isAnswer)
}
setCandelBar(state: number) {
this._cakeBar.updateUI(this._questionIndex, state);
console.log("setCandelBar");
if (state == 2) {
this._wrongQuestion++;
}
}
async nextStep(isAnswer) {
......@@ -344,7 +377,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
console.log("start evolution");
asyncTweenTo(this.candleRoot, 0.5, { x: -cc.winSize.width })
asyncTweenTo(this.choseARoot, 0.5, { x: cc.winSize.width })
asyncTweenTo(this.choseBRoot, 0.5, { x: cc.winSize.width })
......@@ -364,11 +396,21 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.candleRoot.active = true;
this._candle.setSkin(1);
await asyncTweenTo(this.candleRoot, 0.5, { x: -550 })
this.answerNode.node.active = true;
asyncTweenTo(this.candleRoot, 0.5, { x: -550 });
await asyncTweenTo(this.answerNode.node, 0.5, { x: 500 });
this._startCourseware();
} else {
this.cakePiece.active = false;
asyncTweenTo(this.candleRoot, 0.5, { x: -cc.winSize.width })
asyncTweenTo(this.choseARoot, 0.5, { x: cc.winSize.width })
asyncTweenTo(this.choseBRoot, 0.5, { x: cc.winSize.width })
asyncTweenTo(this.audioRoot, 0.5, { x: cc.winSize.width })
await asyncTweenTo(this.cakeRoot, 0.5, { x: cc.winSize.width })
this._toNextQueston();
}
......@@ -398,19 +440,29 @@ export default class SceneComponent extends MyCocosSceneComponent {
this._coursewareStoped();
}
_answerNow() {
this._coursewareStoped();
}
async _coursewareStoped() {
if (this._coursewareDone) return;
this._coursewareDone = true;
this._candle.fireStop();
asyncTweenTo(this.candleRoot, 0.5, { x: -cc.winSize.width });
asyncTweenTo(this.answerNode.node, 0.5, { x: cc.winSize.width });
this.cover.active = true;
cc.tween(this.cover).to(0.5, { opacity: 255 }).start();
await asyncDelay(0.5);
if (window["courseware"]?.stopTest) {
window["courseware"]?.stopTest(this._coursewareEnd.bind(this));
window["courseware"]?.stopTest((res) => {
this._coursewareEnd(res.result?.pronunciation || 0)
});
} else {
await asyncDelay(3);
console.log("web 模拟录音评测 结果");
this._coursewareEnd(Math.random() > 0.5 ? 100 : 70)
......@@ -420,6 +472,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
async _coursewareEnd(score: number) {
if (score >= 80) {
console.log("good");
this.excellent.node.active = true;
this.excellent.playAnimation("newAnimation", 1);
......@@ -428,6 +482,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.excellent.node.active = false;
cc.tween(this.cover).to(0.5, { opacity: 0 }).start();
this.setCandelBar(1)
await asyncDelay(0.5);
this.cover.active = false;
......@@ -438,6 +493,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
} else {
this.setCandelBar(2)
this.nictTry.y = cc.winSize.height;
this.nictTry.active = true;
cc.tween(this.nictTry).
......@@ -483,8 +539,58 @@ export default class SceneComponent extends MyCocosSceneComponent {
endQuestion() {
console.log("endQuestion");
async endQuestion() {
console.log("endQuestion this._wrongQuestion = " + this._wrongQuestion);
this.cover.active = true;
this.cover.opacity = 0;
cc.tween(this.cover).to(0.5, { opacity: 255 }).start();
this.endRoot.active = true;
if (this._wrongQuestion == 0) {
this.endRoot.active = true;
this.endRoot.getChildByName("flower").active = true;
this.playLocalAudio("effect_all_right");
await asyncDelay(3);
onHomeworkFinish();
} else {
if (this._wrongQuestion / this._totalQuestion <= 0.2) {
let node = this.endRoot.getChildByName("nicetry")
node.y = cc.winSize.height;
node.active = true;
cc.tween(node).
to(0.5, { y: -cc.winSize.height / 10 }, { easing: "bounceIn" }).
call(() => {
this.playLocalAudio("effect_nicetry")
}).
to(0.3, { y: 0 }, { easing: "bounceOut" }).
delay(1).
to(0.5, { y: -cc.winSize.height }).call(async () => {
onHomeworkFinish();
}).start();
} else {
let node = this.endRoot.getChildByName("comeon")
node.y = cc.winSize.height;
node.active = true;
cc.tween(node).
to(0.5, { y: -cc.winSize.height / 10 }, { easing: "bounceIn" }).
call(() => {
this.playLocalAudio("effect_final_report")
}).
to(0.3, { y: 0 }, { easing: "bounceOut" }).
delay(1).
to(0.5, { y: -cc.winSize.height }).call(async () => {
onHomeworkFinish();
}).start();
}
}
}
initListener() {
......
......@@ -42,6 +42,49 @@ export const defaultData = {
"testWaitTime": 3,
"rightLetter": "a",
"wrongLetter": "e"
},
{
"text": "apple",
"audio": "http://staging-teach.cdn.ireadabc.com/7c18e0838dcf0707f885842ed09e1579.mp3",
"dragonBoneData": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/703a41d6c7afe6fe653014d585ef0d58.json",
"name": "d1_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/02bbebdc4a9f4a35d9ec285f61fca19c.json",
"name": "d1_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/ba2041fb4f69c37be52b76f5fb274c09.png",
"name": "d1_tex.png"
}
},
"choosewaitTime": 5,
"testWaitTime": 3,
"rightLetter": "a",
"wrongLetter": "e"
}, {
"text": "apple",
"audio": "http://staging-teach.cdn.ireadabc.com/7c18e0838dcf0707f885842ed09e1579.mp3",
"dragonBoneData": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/703a41d6c7afe6fe653014d585ef0d58.json",
"name": "d1_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/02bbebdc4a9f4a35d9ec285f61fca19c.json",
"name": "d1_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/ba2041fb4f69c37be52b76f5fb274c09.png",
"name": "d1_tex.png"
}
},
"choosewaitTime": 5,
"testWaitTime": 3,
"rightLetter": "a",
"wrongLetter": "e"
}],
"title": "whats you name",
"guideAudio": "http://staging-teach.cdn.ireadabc.com/40468ef6d120d03f83541b9344c6f9ea.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