Commit 5cb77a3c authored by Tt's avatar Tt

1

parent dec51142
{
"ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
{"ver":"1.1.2","uuid":"c35bb2f6-f24a-4850-ae44-643f2fdc7541","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
\ No newline at end of file
......@@ -75,43 +75,43 @@
"__id__": 5
},
{
"__id__": 21
"__id__": 27
},
{
"__id__": 23
"__id__": 29
},
{
"__id__": 26
"__id__": 32
},
{
"__id__": 28
"__id__": 34
},
{
"__id__": 64
"__id__": 70
},
{
"__id__": 76
"__id__": 82
},
{
"__id__": 110
"__id__": 116
},
{
"__id__": 126
"__id__": 132
},
{
"__id__": 132
"__id__": 138
}
],
"_active": true,
"_components": [
{
"__id__": 147
"__id__": 153
},
{
"__id__": 148
"__id__": 154
},
{
"__id__": 149
"__id__": 155
}
],
"_prefab": null,
......@@ -270,6 +270,12 @@
"_children": [
{
"__id__": 6
},
{
"__id__": 21
},
{
"__id__": 24
}
],
"_active": true,
......@@ -969,6 +975,321 @@
"preload": false,
"_id": "9c00bG8ndKapYjv7UaV/kz"
},
{
"__type__": "cc.Node",
"_name": "font",
"_objFlags": 0,
"_parent": {
"__id__": 5
},
"_children": [
{
"__id__": 22
}
],
"_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": "f5nh00nj5NuIH4fR3vWu/O"
},
{
"__type__": "cc.Node",
"_name": "BRLNSDB",
"_objFlags": 0,
"_parent": {
"__id__": 21
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 23
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 50.4
},
"_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": "77rvTJQUFJGqhTBLqPlVrr"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "",
"_N$string": "",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "c551970e-b095-45f3-9f1d-25cde8b8deb1"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 0,
"_N$verticalAlign": 0,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "1eN2+tNFxOlLBKpKwZGEjp"
},
{
"__type__": "cc.Node",
"_name": "img",
"_objFlags": 0,
"_parent": {
"__id__": 5
},
"_children": [
{
"__id__": 25
}
],
"_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": "c8DiRwGXRKCbTNrO23KYmQ"
},
{
"__type__": "cc.Node",
"_name": "icon",
"_objFlags": 0,
"_parent": {
"__id__": 24
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 26
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 815,
"height": 488
},
"_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": "c2RbblMz1H7LpBvi0m0T4e"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "677e271f-5c8c-407a-b434-6c13aa1ab8d0"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "faFj+r6S5OeaUt1AQjKPr7"
},
{
"__type__": "cc.Node",
"_name": "btn_return",
......@@ -980,7 +1301,7 @@
"_active": false,
"_components": [
{
"__id__": 22
"__id__": 28
}
],
"_prefab": null,
......@@ -1036,7 +1357,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 21
"__id__": 27
},
"_enabled": true,
"_materials": [
......@@ -1074,10 +1395,10 @@
"_active": true,
"_components": [
{
"__id__": 24
"__id__": 30
},
{
"__id__": 25
"__id__": 31
}
],
"_prefab": null,
......@@ -1133,7 +1454,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 23
"__id__": 29
},
"_enabled": true,
"_materials": [
......@@ -1165,7 +1486,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 23
"__id__": 29
},
"_enabled": true,
"alignMode": 1,
......@@ -1198,7 +1519,7 @@
"_active": true,
"_components": [
{
"__id__": 27
"__id__": 33
}
],
"_prefab": null,
......@@ -1254,7 +1575,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 26
"__id__": 32
},
"_enabled": true,
"_materials": [
......@@ -1290,16 +1611,16 @@
},
"_children": [
{
"__id__": 29
"__id__": 35
},
{
"__id__": 46
"__id__": 52
}
],
"_active": true,
"_components": [
{
"__id__": 63
"__id__": 69
}
],
"_prefab": null,
......@@ -1355,14 +1676,14 @@
"_name": "player",
"_objFlags": 0,
"_parent": {
"__id__": 28
"__id__": 34
},
"_children": [
{
"__id__": 30
"__id__": 36
},
{
"__id__": 32
"__id__": 38
}
],
"_active": true,
......@@ -1420,13 +1741,13 @@
"_name": "icon_player",
"_objFlags": 0,
"_parent": {
"__id__": 29
"__id__": 35
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 31
"__id__": 37
}
],
"_prefab": null,
......@@ -1482,7 +1803,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 30
"__id__": 36
},
"_enabled": true,
"_materials": [
......@@ -1514,32 +1835,32 @@
"_name": "icon_player_dice",
"_objFlags": 0,
"_parent": {
"__id__": 29
"__id__": 35
},
"_children": [
{
"__id__": 33
"__id__": 39
},
{
"__id__": 35
"__id__": 41
},
{
"__id__": 37
"__id__": 43
},
{
"__id__": 39
"__id__": 45
},
{
"__id__": 41
"__id__": 47
},
{
"__id__": 43
"__id__": 49
}
],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 45
"__id__": 51
}
],
"_prefab": null,
......@@ -1595,13 +1916,13 @@
"_name": "icon_6",
"_objFlags": 0,
"_parent": {
"__id__": 32
"__id__": 38
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 34
"__id__": 40
}
],
"_prefab": null,
......@@ -1657,7 +1978,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 33
"__id__": 39
},
"_enabled": true,
"_materials": [
......@@ -1689,13 +2010,13 @@
"_name": "icon_4",
"_objFlags": 0,
"_parent": {
"__id__": 32
"__id__": 38
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 36
"__id__": 42
}
],
"_prefab": null,
......@@ -1751,7 +2072,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 35
"__id__": 41
},
"_enabled": true,
"_materials": [
......@@ -1783,13 +2104,13 @@
"_name": "icon_5",
"_objFlags": 0,
"_parent": {
"__id__": 32
"__id__": 38
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 38
"__id__": 44
}
],
"_prefab": null,
......@@ -1845,7 +2166,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 37
"__id__": 43
},
"_enabled": true,
"_materials": [
......@@ -1877,13 +2198,13 @@
"_name": "icon_3",
"_objFlags": 0,
"_parent": {
"__id__": 32
"__id__": 38
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 40
"__id__": 46
}
],
"_prefab": null,
......@@ -1909,8 +2230,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-0.168,
132.039,
0,
131.65,
0,
0,
0,
......@@ -1932,14 +2253,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "dcEkykorhOsJNpTmB4cgYp"
"_id": "13l6a4sAdLJ4G/jG3FIqia"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 39
"__id__": 45
},
"_enabled": true,
"_materials": [
......@@ -1964,20 +2285,20 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "edZWvegLZOELWkWYunnbZW"
"_id": "adKF/t3YNIEb10kfC5k4X8"
},
{
"__type__": "cc.Node",
"_name": "icon_2",
"_objFlags": 0,
"_parent": {
"__id__": 32
"__id__": 38
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 42
"__id__": 48
}
],
"_prefab": null,
......@@ -2033,7 +2354,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 41
"__id__": 47
},
"_enabled": true,
"_materials": [
......@@ -2065,13 +2386,13 @@
"_name": "icon_1",
"_objFlags": 0,
"_parent": {
"__id__": 32
"__id__": 38
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 44
"__id__": 50
}
],
"_prefab": null,
......@@ -2127,7 +2448,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 43
"__id__": 49
},
"_enabled": true,
"_materials": [
......@@ -2159,7 +2480,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 32
"__id__": 38
},
"_enabled": true,
"_materials": [
......@@ -2191,14 +2512,14 @@
"_name": "robot",
"_objFlags": 0,
"_parent": {
"__id__": 28
"__id__": 34
},
"_children": [
{
"__id__": 47
"__id__": 53
},
{
"__id__": 49
"__id__": 55
}
],
"_active": true,
......@@ -2256,13 +2577,13 @@
"_name": "icon_robot",
"_objFlags": 0,
"_parent": {
"__id__": 46
"__id__": 52
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 48
"__id__": 54
}
],
"_prefab": null,
......@@ -2318,7 +2639,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 47
"__id__": 53
},
"_enabled": true,
"_materials": [
......@@ -2350,32 +2671,32 @@
"_name": "icon_robot_dice",
"_objFlags": 0,
"_parent": {
"__id__": 46
"__id__": 52
},
"_children": [
{
"__id__": 50
"__id__": 56
},
{
"__id__": 52
"__id__": 58
},
{
"__id__": 54
"__id__": 60
},
{
"__id__": 56
"__id__": 62
},
{
"__id__": 58
"__id__": 64
},
{
"__id__": 60
"__id__": 66
}
],
"_active": false,
"_components": [
{
"__id__": 62
"__id__": 68
}
],
"_prefab": null,
......@@ -2431,13 +2752,13 @@
"_name": "icon_6",
"_objFlags": 0,
"_parent": {
"__id__": 49
"__id__": 55
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 51
"__id__": 57
}
],
"_prefab": null,
......@@ -2493,7 +2814,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 50
"__id__": 56
},
"_enabled": true,
"_materials": [
......@@ -2525,13 +2846,13 @@
"_name": "icon_4",
"_objFlags": 0,
"_parent": {
"__id__": 49
"__id__": 55
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 53
"__id__": 59
}
],
"_prefab": null,
......@@ -2587,7 +2908,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 52
"__id__": 58
},
"_enabled": true,
"_materials": [
......@@ -2619,13 +2940,13 @@
"_name": "icon_5",
"_objFlags": 0,
"_parent": {
"__id__": 49
"__id__": 55
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 55
"__id__": 61
}
],
"_prefab": null,
......@@ -2681,7 +3002,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 54
"__id__": 60
},
"_enabled": true,
"_materials": [
......@@ -2713,13 +3034,13 @@
"_name": "icon_3",
"_objFlags": 0,
"_parent": {
"__id__": 49
"__id__": 55
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 57
"__id__": 63
}
],
"_prefab": null,
......@@ -2775,7 +3096,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 56
"__id__": 62
},
"_enabled": true,
"_materials": [
......@@ -2807,13 +3128,13 @@
"_name": "icon_2",
"_objFlags": 0,
"_parent": {
"__id__": 49
"__id__": 55
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 59
"__id__": 65
}
],
"_prefab": null,
......@@ -2869,7 +3190,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 58
"__id__": 64
},
"_enabled": true,
"_materials": [
......@@ -2901,13 +3222,13 @@
"_name": "icon_1",
"_objFlags": 0,
"_parent": {
"__id__": 49
"__id__": 55
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 61
"__id__": 67
}
],
"_prefab": null,
......@@ -2963,7 +3284,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 60
"__id__": 66
},
"_enabled": true,
"_materials": [
......@@ -2995,7 +3316,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 49
"__id__": 55
},
"_enabled": true,
"_materials": [
......@@ -3027,7 +3348,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 28
"__id__": 34
},
"_enabled": true,
"label": null,
......@@ -3043,16 +3364,16 @@
},
"_children": [
{
"__id__": 65
"__id__": 71
},
{
"__id__": 70
"__id__": 76
}
],
"_active": true,
"_components": [
{
"__id__": 75
"__id__": 81
}
],
"_prefab": null,
......@@ -3108,20 +3429,20 @@
"_name": "chess_player",
"_objFlags": 0,
"_parent": {
"__id__": 64
"__id__": 70
},
"_children": [
{
"__id__": 66
"__id__": 72
}
],
"_active": true,
"_components": [
{
"__id__": 68
"__id__": 74
},
{
"__id__": 69
"__id__": 75
}
],
"_prefab": null,
......@@ -3177,13 +3498,13 @@
"_name": "star",
"_objFlags": 0,
"_parent": {
"__id__": 65
"__id__": 71
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 67
"__id__": 73
}
],
"_prefab": null,
......@@ -3239,7 +3560,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 66
"__id__": 72
},
"_enabled": true,
"_clip": {
......@@ -3258,7 +3579,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 65
"__id__": 71
},
"_enabled": true,
"_materials": [
......@@ -3290,7 +3611,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 65
"__id__": 71
},
"_enabled": true,
"isRobot": false,
......@@ -3301,20 +3622,20 @@
"_name": "chess_robot",
"_objFlags": 0,
"_parent": {
"__id__": 64
"__id__": 70
},
"_children": [
{
"__id__": 71
"__id__": 77
}
],
"_active": true,
"_components": [
{
"__id__": 73
"__id__": 79
},
{
"__id__": 74
"__id__": 80
}
],
"_prefab": null,
......@@ -3370,13 +3691,13 @@
"_name": "star",
"_objFlags": 0,
"_parent": {
"__id__": 70
"__id__": 76
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 72
"__id__": 78
}
],
"_prefab": null,
......@@ -3432,7 +3753,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 71
"__id__": 77
},
"_enabled": true,
"_clip": {
......@@ -3451,7 +3772,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 70
"__id__": 76
},
"_enabled": true,
"_materials": [
......@@ -3483,7 +3804,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 70
"__id__": 76
},
"_enabled": true,
"isRobot": true,
......@@ -3494,7 +3815,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 64
"__id__": 70
},
"_enabled": true,
"alignMode": 1,
......@@ -3525,19 +3846,19 @@
},
"_children": [
{
"__id__": 77
"__id__": 83
},
{
"__id__": 103
"__id__": 109
},
{
"__id__": 106
"__id__": 112
}
],
"_active": false,
"_components": [
{
"__id__": 109
"__id__": 115
}
],
"_prefab": null,
......@@ -3593,18 +3914,9 @@
"_name": "icon",
"_objFlags": 0,
"_parent": {
"__id__": 76
"__id__": 82
},
"_children": [
{
"__id__": 78
},
{
"__id__": 80
},
{
"__id__": 82
},
{
"__id__": 84
},
......@@ -3631,12 +3943,21 @@
},
{
"__id__": 100
},
{
"__id__": 102
},
{
"__id__": 104
},
{
"__id__": 106
}
],
"_active": true,
"_components": [
{
"__id__": 102
"__id__": 108
}
],
"_prefab": null,
......@@ -3692,13 +4013,13 @@
"_name": "bg_1",
"_objFlags": 0,
"_parent": {
"__id__": 77
"__id__": 83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 79
"__id__": 85
}
],
"_prefab": null,
......@@ -3754,7 +4075,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 78
"__id__": 84
},
"_enabled": true,
"_materials": [
......@@ -3786,13 +4107,13 @@
"_name": "bg_2",
"_objFlags": 0,
"_parent": {
"__id__": 77
"__id__": 83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 81
"__id__": 87
}
],
"_prefab": null,
......@@ -3848,7 +4169,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 80
"__id__": 86
},
"_enabled": true,
"_materials": [
......@@ -3880,13 +4201,13 @@
"_name": "bg_3",
"_objFlags": 0,
"_parent": {
"__id__": 77
"__id__": 83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 83
"__id__": 89
}
],
"_prefab": null,
......@@ -3942,7 +4263,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 82
"__id__": 88
},
"_enabled": true,
"_materials": [
......@@ -3974,13 +4295,13 @@
"_name": "bg_4",
"_objFlags": 0,
"_parent": {
"__id__": 77
"__id__": 83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 85
"__id__": 91
}
],
"_prefab": null,
......@@ -4036,7 +4357,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 84
"__id__": 90
},
"_enabled": true,
"_materials": [
......@@ -4068,13 +4389,13 @@
"_name": "bg_5",
"_objFlags": 0,
"_parent": {
"__id__": 77
"__id__": 83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 87
"__id__": 93
}
],
"_prefab": null,
......@@ -4130,7 +4451,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 86
"__id__": 92
},
"_enabled": true,
"_materials": [
......@@ -4162,13 +4483,13 @@
"_name": "bg_6",
"_objFlags": 0,
"_parent": {
"__id__": 77
"__id__": 83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 89
"__id__": 95
}
],
"_prefab": null,
......@@ -4224,7 +4545,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 88
"__id__": 94
},
"_enabled": true,
"_materials": [
......@@ -4256,13 +4577,13 @@
"_name": "bg_dice3",
"_objFlags": 0,
"_parent": {
"__id__": 77
"__id__": 83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 91
"__id__": 97
}
],
"_prefab": null,
......@@ -4318,7 +4639,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 90
"__id__": 96
},
"_enabled": true,
"_materials": [
......@@ -4350,13 +4671,13 @@
"_name": "bg_dice2",
"_objFlags": 0,
"_parent": {
"__id__": 77
"__id__": 83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 93
"__id__": 99
}
],
"_prefab": null,
......@@ -4412,7 +4733,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 92
"__id__": 98
},
"_enabled": true,
"_materials": [
......@@ -4444,13 +4765,13 @@
"_name": "bg_dice1",
"_objFlags": 0,
"_parent": {
"__id__": 77
"__id__": 83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 95
"__id__": 101
}
],
"_prefab": null,
......@@ -4506,7 +4827,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 94
"__id__": 100
},
"_enabled": true,
"_materials": [
......@@ -4538,13 +4859,13 @@
"_name": "bg_dice5",
"_objFlags": 0,
"_parent": {
"__id__": 77
"__id__": 83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 97
"__id__": 103
}
],
"_prefab": null,
......@@ -4600,7 +4921,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 96
"__id__": 102
},
"_enabled": true,
"_materials": [
......@@ -4632,13 +4953,13 @@
"_name": "bg_dice4",
"_objFlags": 0,
"_parent": {
"__id__": 77
"__id__": 83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 99
"__id__": 105
}
],
"_prefab": null,
......@@ -4694,7 +5015,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 98
"__id__": 104
},
"_enabled": true,
"_materials": [
......@@ -4726,13 +5047,13 @@
"_name": "bg_dice6",
"_objFlags": 0,
"_parent": {
"__id__": 77
"__id__": 83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 101
"__id__": 107
}
],
"_prefab": null,
......@@ -4788,7 +5109,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 100
"__id__": 106
},
"_enabled": true,
"_materials": [
......@@ -4820,7 +5141,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 77
"__id__": 83
},
"_enabled": true,
"label": null,
......@@ -4832,16 +5153,16 @@
"_name": "btn_stop",
"_objFlags": 0,
"_parent": {
"__id__": 76
"__id__": 82
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 104
"__id__": 110
},
{
"__id__": 105
"__id__": 111
}
],
"_prefab": null,
......@@ -4897,7 +5218,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 103
"__id__": 109
},
"_enabled": true,
"_materials": [
......@@ -4929,7 +5250,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 103
"__id__": 109
},
"_enabled": true,
"_normalMaterial": null,
......@@ -4990,7 +5311,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 103
"__id__": 109
},
"_id": "6btfsmisBFibMp9UnkII+V"
},
......@@ -4999,16 +5320,16 @@
"_name": "hand",
"_objFlags": 0,
"_parent": {
"__id__": 76
"__id__": 82
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 107
"__id__": 113
},
{
"__id__": 108
"__id__": 114
}
],
"_prefab": null,
......@@ -5064,7 +5385,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 106
"__id__": 112
},
"_enabled": true,
"_materials": [
......@@ -5096,7 +5417,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 106
"__id__": 112
},
"_enabled": true,
"label": null,
......@@ -5108,7 +5429,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 76
"__id__": 82
},
"_enabled": true,
"_materials": [
......@@ -5144,31 +5465,31 @@
},
"_children": [
{
"__id__": 111
"__id__": 117
},
{
"__id__": 113
"__id__": 119
},
{
"__id__": 116
"__id__": 122
},
{
"__id__": 118
"__id__": 124
},
{
"__id__": 120
"__id__": 126
},
{
"__id__": 122
"__id__": 128
}
],
"_active": true,
"_components": [
{
"__id__": 124
"__id__": 130
},
{
"__id__": 125
"__id__": 131
}
],
"_prefab": null,
......@@ -5224,13 +5545,13 @@
"_name": "text_tip",
"_objFlags": 0,
"_parent": {
"__id__": 110
"__id__": 116
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 112
"__id__": 118
}
],
"_prefab": null,
......@@ -5286,7 +5607,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 111
"__id__": 117
},
"_enabled": true,
"_materials": [
......@@ -5318,16 +5639,16 @@
"_name": "btn_audio_start",
"_objFlags": 0,
"_parent": {
"__id__": 110
"__id__": 116
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 114
"__id__": 120
},
{
"__id__": 115
"__id__": 121
}
],
"_prefab": null,
......@@ -5383,7 +5704,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 113
"__id__": 119
},
"_enabled": true,
"_materials": [
......@@ -5415,7 +5736,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 113
"__id__": 119
},
"_enabled": true,
"_normalMaterial": null,
......@@ -5483,13 +5804,13 @@
"_name": "btn_audio_stop",
"_objFlags": 0,
"_parent": {
"__id__": 110
"__id__": 116
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 117
"__id__": 123
}
],
"_prefab": null,
......@@ -5545,7 +5866,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 116
"__id__": 122
},
"_enabled": true,
"_materials": [
......@@ -5577,13 +5898,13 @@
"_name": "speak_ske",
"_objFlags": 0,
"_parent": {
"__id__": 110
"__id__": 116
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 119
"__id__": 125
}
],
"_prefab": null,
......@@ -5639,7 +5960,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 118
"__id__": 124
},
"_enabled": true,
"_materials": [
......@@ -5679,13 +6000,13 @@
"_name": "bg_goodjob",
"_objFlags": 0,
"_parent": {
"__id__": 110
"__id__": 116
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 121
"__id__": 127
}
],
"_prefab": null,
......@@ -5741,7 +6062,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 120
"__id__": 126
},
"_enabled": true,
"_materials": [
......@@ -5773,13 +6094,13 @@
"_name": "bg_tryagain",
"_objFlags": 0,
"_parent": {
"__id__": 110
"__id__": 116
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 123
"__id__": 129
}
],
"_prefab": null,
......@@ -5835,7 +6156,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 122
"__id__": 128
},
"_enabled": true,
"_materials": [
......@@ -5867,7 +6188,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 110
"__id__": 116
},
"_enabled": true,
"alignMode": 1,
......@@ -5894,7 +6215,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 110
"__id__": 116
},
"_enabled": true,
"label": null,
......@@ -5910,16 +6231,16 @@
},
"_children": [
{
"__id__": 127
"__id__": 133
},
{
"__id__": 129
"__id__": 135
}
],
"_active": true,
"_components": [
{
"__id__": 131
"__id__": 137
}
],
"_prefab": null,
......@@ -5975,13 +6296,13 @@
"_name": "bg_win",
"_objFlags": 0,
"_parent": {
"__id__": 126
"__id__": 132
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 128
"__id__": 134
}
],
"_prefab": null,
......@@ -6037,7 +6358,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 127
"__id__": 133
},
"_enabled": true,
"_materials": [
......@@ -6069,13 +6390,13 @@
"_name": "bg_lose",
"_objFlags": 0,
"_parent": {
"__id__": 126
"__id__": 132
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 130
"__id__": 136
}
],
"_prefab": null,
......@@ -6131,7 +6452,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 129
"__id__": 135
},
"_enabled": true,
"_materials": [
......@@ -6163,7 +6484,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 126
"__id__": 132
},
"_enabled": true,
"alignMode": 1,
......@@ -6194,25 +6515,25 @@
},
"_children": [
{
"__id__": 133
"__id__": 139
},
{
"__id__": 136
"__id__": 142
},
{
"__id__": 139
"__id__": 145
},
{
"__id__": 142
"__id__": 148
}
],
"_active": true,
"_components": [
{
"__id__": 145
"__id__": 151
},
{
"__id__": 146
"__id__": 152
}
],
"_prefab": null,
......@@ -6268,16 +6589,16 @@
"_name": "panel_gray",
"_objFlags": 0,
"_parent": {
"__id__": 132
"__id__": 138
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 134
"__id__": 140
},
{
"__id__": 135
"__id__": 141
}
],
"_prefab": null,
......@@ -6333,7 +6654,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 133
"__id__": 139
},
"_enabled": true,
"_materials": [
......@@ -6365,7 +6686,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 133
"__id__": 139
},
"_enabled": true,
"_id": "e4yCZbisZBGZqMqHEXBseL"
......@@ -6375,16 +6696,16 @@
"_name": "btn_start",
"_objFlags": 0,
"_parent": {
"__id__": 132
"__id__": 138
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 137
"__id__": 143
},
{
"__id__": 138
"__id__": 144
}
],
"_prefab": null,
......@@ -6440,7 +6761,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 136
"__id__": 142
},
"_enabled": true,
"_materials": [
......@@ -6472,7 +6793,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 136
"__id__": 142
},
"_enabled": true,
"_normalMaterial": null,
......@@ -6533,7 +6854,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 136
"__id__": 142
},
"_id": "57btGK5ftHapBJVGaJiIv5"
},
......@@ -6542,16 +6863,16 @@
"_name": "btn_restart",
"_objFlags": 0,
"_parent": {
"__id__": 132
"__id__": 138
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 140
"__id__": 146
},
{
"__id__": 141
"__id__": 147
}
],
"_prefab": null,
......@@ -6607,7 +6928,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 139
"__id__": 145
},
"_enabled": true,
"_materials": [
......@@ -6639,7 +6960,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 139
"__id__": 145
},
"_enabled": true,
"_normalMaterial": null,
......@@ -6700,7 +7021,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 139
"__id__": 145
},
"_id": "b3sVKz5e1PN4fADR0phF4M"
},
......@@ -6709,16 +7030,16 @@
"_name": "bg_vs",
"_objFlags": 0,
"_parent": {
"__id__": 132
"__id__": 138
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 143
"__id__": 149
},
{
"__id__": 144
"__id__": 150
}
],
"_prefab": null,
......@@ -6774,7 +7095,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 142
"__id__": 148
},
"_enabled": true,
"_materials": [
......@@ -6806,7 +7127,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 142
"__id__": 148
},
"_enabled": true,
"alignMode": 1,
......@@ -6833,7 +7154,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 132
"__id__": 138
},
"_enabled": true,
"label": null,
......@@ -6845,7 +7166,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 132
"__id__": 138
},
"_enabled": true,
"alignMode": 1,
......@@ -6912,13 +7233,13 @@
"_id": "0dy9tHRJNBYq2rl91tk65I"
},
{
"__type__": "408a6f4ZfpM8Yzyg+IOGg/V",
"__type__": "70918kKQJdMdLOI4L5Tj5wc",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_id": "863D556WtLbqdZNSjTfHFT"
"_id": "bdHDCGTxRCQZU1gSyCtIXb"
}
]
\ No newline at end of file
......@@ -4,33 +4,37 @@ import pg from "./pg";
import map from "./map";
const { ccclass, property } = cc._decorator;
enum CELLTYPE {
SPEAK = 1,
MOVE_ADD = 2,
ROLL_AGAIN = 3,
DELAY_TIME = 4,
JUMP_ROLL = 5,
WIN = 100,
const CELLTYPE = {
SPEAK: 1,
MOVE_ADD: 2,
ROLL_AGAIN: 3,
DELAY_TIME: 4,
JUMP_ROLL: 5,
WIN: 100,
}
@ccclass
export default class SceneComponent extends MyCocosSceneComponent {
export default class NewClass extends MyCocosSceneComponent {
addPreloadImage() {
this.log("test addPreloadImage")
// TODO 根据自己的配置预加载图片资源
this._imageResList.push({ url: this.data.pic_url });
this._imageResList.push({ url: this.data.pic_url_2 });
this.data && this._imageResList.push({ url: this.data.pic_url });
this.data && this._imageResList.push({ url: this.data.pic_url_2 });
}
addPreloadAudio() {
this.log("test addPreloadAudio")
// TODO 根据自己的配置预加载音频资源
this._audioResList.push({ url: this.data.audio_url });
this.data && this._audioResList.push({ url: this.data.audio_url });
}
addPreloadAnima() {
this.log("test addPreloadAnima")
}
onLoadEnd() {
this.log("test onLoadEnd")
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this.initData();
this.initView();
......@@ -39,35 +43,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
_cantouch = null;
initData() {
this.log("test initData")
// 所有全局变量 默认都是null
this._cantouch = true;
}
//开发流程
//1.start状态
//2.开局效果
//3.骰子动效,stop效果。
//4.星星位移。
//--游戏开始就计算好后续的所有点数数组。
//--骰子及位移点数等添加到一个数组中,每次需要获取当前点和目标点时进行实时获取。
//--出现错误反向退回。
//--位移停止后触发目的地内容。
//5.触发目的地道具效果。
//--如各类道具,进行分类。统一调用一个方法输入,给予id
//--如:终点。可触发终点效果。
//--如:语音。触发语音效果。
//--如:加速。触发位移效果。
//6.语音录音部分。
//--动画组件,start end。
//7.机器人骰子及自动进程。
//--机器人难度处理,游戏开始就计算好后续的所有点数数组。
//--调用通用的内容进行位移。
//8.结算胜负
//9.重新开始
initView() {
this.log("test initView")
this.initTouzi();
this.initChess();
}
initEvent() {
this.log("test initEvent")
pg.event.on("game_start", () => { this.onGameStart() })
pg.event.on("speak_success", () => { this.onSpeakScueess() });
......@@ -245,16 +231,16 @@ export default class SceneComponent extends MyCocosSceneComponent {
let touzi = icon.getComponent("touzi");
let hand = pg.view.find(touzi_ani, "hand");
let btn_stop = pg.view.find(touzi_ani, "btn_stop");
btn_stop.active = false;
pg.view.visible(btn_stop, false);
this.lastPointId = this.playerPoint + 1;
if (!runNum) {
runNum = 1 + Math.floor(Math.random() * 6);
if (this.turnRobot) runNum = 1 + Math.floor(Math.random() * 5);
}
hand.active = false;
pg.view.visible(hand, false);
clearTimeout(this.stopHandTimer);
touzi.stopAni(runNum).then(() => {
touzi_ani.active = false;
pg.view.visible(touzi_ani, false);
pg.event.emit("player_point_update", { isRobot: this.turnRobot, num: runNum });
this.moveChess(runNum).then(() => {
this.checkCell();
......@@ -269,8 +255,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
let touzi = icon.getComponent("touzi");
let hand = pg.view.find(touzi_ani, "hand");
let btn_stop = pg.view.find(touzi_ani, "btn_stop");
btn_stop.active = true;
touzi_ani.active = true;
pg.view.visible(btn_stop, true);
pg.view.visible(touzi_ani, true);
touzi.startAni();
if (this.turnRobot) {
setTimeout(() => {
......@@ -278,7 +264,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}, 300 + Math.random() * 200);
} else {
this.stopHandTimer = setTimeout(() => {
hand.active = true;
pg.view.visible(hand, true);
}, 5000);
}
pg.hw.playLocalAudio("touzi", true).then((id: number) => {
......
{
"ver": "1.0.8",
"uuid": "408a67f8-65fa-4cf1-8cf2-83e20e1a0fd5",
"uuid": "7091890a-4097-4c74-b388-e0be538f9c1c",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
import { asyncDelay, onHomeworkFinish } from "../script/util";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent";
import pg from "./pg";
import map from "./map";
const { ccclass, property } = cc._decorator;
const CELLTYPE = {
SPEAK: 1,
MOVE_ADD: 2,
ROLL_AGAIN: 3,
DELAY_TIME: 4,
JUMP_ROLL: 5,
WIN: 100,
}
@ccclass
export default class SceneComponent extends MyCocosSceneComponent {
addPreloadImage() {
this.log("test addPreloadImage")
// TODO 根据自己的配置预加载图片资源
this._imageResList.push({ url: this.data.pic_url });
this._imageResList.push({ url: this.data.pic_url_2 });
}
addPreloadAudio() {
this.log("test addPreloadAudio")
// TODO 根据自己的配置预加载音频资源
this._audioResList.push({ url: this.data.audio_url });
}
addPreloadAnima() {
this.log("test addPreloadAnima")
}
onLoadEnd() {
this.log("test onLoadEnd")
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this.initData();
this.initView();
this.initEvent();
}
_cantouch = null;
initData() {
// 所有全局变量 默认都是null
this._cantouch = true;
}
initView() {
this.initTouzi();
this.initChess();
}
initEvent() {
pg.event.on("game_start", () => { this.onGameStart() })
pg.event.on("speak_success", () => { this.onSpeakScueess() });
pg.event.on("speak_fail", () => { this.onSpeakFail() });
}
//-----------------------------流程------------------------------
private playerPoint: number;//
private robotPoint: number;//
private turnRobot: boolean;//当前是谁操作
onGameStart() {
this.playerPoint = 0;
this.robotPoint = 0;
this.turnRobot = Math.random() < 0.5;
this.initChess();
setTimeout(() => {
this.startTouzi();
}, 2100);
}
onSpeakScueess() {
//执行后续的动作。
this.turnNext();
}
onSpeakFail() {
//回退到最后一个位置
let cell = map[this.playerPoint];
this.jumpChess(cell, this.lastPointId).then(() => {
this.turnNext();
})
}
turnNext() {
this.turnRobot = !this.turnRobot;
this.startTouzi();
}
//-----------------------------CHESS-------------------------------
private chessPlayer: cc.Node;
private chessRobot: cc.Node;
initChess() {
//初始化棋子
this.chessPlayer = pg.view.find(this, "chess/chess_player");
this.chessRobot = pg.view.find(this, "chess/chess_robot");
let point = map[0];
this.chessPlayer.x = Number(point.yellow_x);
this.chessPlayer.y = Number(point.yellow_y);
this.chessRobot.x = Number(point.blue_x);
this.chessRobot.y = Number(point.blue_y);
}
getMovePoints(now, runNum) {
let points = [];
for (let i = now; i <= now + runNum; i++) {
let point = map[i];
if (!point) break;
points.push(point);
}
return points;
}
moveChess(runNum) {
return new Promise((resolve, reject) => {
this.runNum = runNum;
if (this.turnRobot) {
let points = this.getMovePoints(this.robotPoint, runNum);
console.log(points);
this.chessRobot.getComponent("chess").run(points).then(() => {
this.robotPoint += (points.length - 1);
resolve('');
})
} else {
let points = this.getMovePoints(this.playerPoint, runNum);
console.log(points);
this.chessPlayer.getComponent("chess").run(points).then(() => {
this.playerPoint += (points.length - 1);
resolve('');
})
}
});
}
jumpChess(cell, jumpId) {
return new Promise((resolve, reject) => {
let jumpCell = map[jumpId - 1];
let points = [cell, jumpCell];
if (this.turnRobot) {
this.chessRobot.getComponent("chess").run(points).then(() => {
this.robotPoint = Number(jumpCell.id) - 1;
resolve('');
})
} else {
this.chessPlayer.getComponent("chess").run(points).then(() => {
this.playerPoint = Number(jumpCell.id) - 1;
resolve('');
})
}
});
}
private runNum: number;
checkCell() {
if (this.turnRobot) {
let cell = map[this.robotPoint];
let val = cell.value;
let type = Number(cell.type);
switch (type) {
case CELLTYPE.MOVE_ADD:
this.moveChess(Number(val)).then(() => {
this.checkCell();
})
break;
case CELLTYPE.ROLL_AGAIN:
this.turnRobot = !this.turnRobot;
this.turnNext();
break;
case CELLTYPE.JUMP_ROLL:
this.jumpChess(cell, Number(val)).then(() => {
this.checkCell();
})
break;
case CELLTYPE.WIN:
this.gameOver();
break;
default:
this.turnNext();
break;
}
return
}
setTimeout(() => {
let cell = map[this.playerPoint];
let val = cell.value;
let type = Number(cell.type);
switch (type) {
case CELLTYPE.SPEAK:
pg.event.emit("speak_open", cell)
break;
case CELLTYPE.DELAY_TIME:
setTimeout(() => {
this.turnNext();
}, 5000);
break;
case CELLTYPE.MOVE_ADD:
this.moveChess(Number(val)).then(() => {
this.checkCell();
})
break;
case CELLTYPE.ROLL_AGAIN:
this.turnRobot = !this.turnRobot;
this.turnNext();
break;
case CELLTYPE.JUMP_ROLL:
this.jumpChess(cell, Number(val)).then(() => {
this.checkCell();
})
break;
case CELLTYPE.WIN:
this.gameOver();
break;
default:
this.turnNext();
break;
}
}, 100);
}
//-----------------------------TOUZI-------------------------------
initTouzi() {
let touzi_ani = pg.view.find(this, "touzi_ani");
let btn_stop = pg.view.find(touzi_ani, "btn_stop");
pg.view.touchOn(btn_stop, this.onTouchStop, this);
}
onTouchStop() {
if (this.turnRobot) return;
this.stopTouzi();
}
lastPointId: number;
stopTouzi(runNum = 0) {
pg.audio.stopAudio(this.touziAudio);
let touzi_ani = pg.view.find(this, "touzi_ani");
let icon = pg.view.find(touzi_ani, "icon");
let touzi = icon.getComponent("touzi");
let hand = pg.view.find(touzi_ani, "hand");
let btn_stop = pg.view.find(touzi_ani, "btn_stop");
pg.view.visible(btn_stop, false);
this.lastPointId = this.playerPoint + 1;
if (!runNum) {
runNum = 1 + Math.floor(Math.random() * 6);
if (this.turnRobot) runNum = 1 + Math.floor(Math.random() * 5);
}
pg.view.visible(hand, false);
clearTimeout(this.stopHandTimer);
touzi.stopAni(runNum).then(() => {
pg.view.visible(touzi_ani, false);
pg.event.emit("player_point_update", { isRobot: this.turnRobot, num: runNum });
this.moveChess(runNum).then(() => {
this.checkCell();
})
})
}
private stopHandTimer: number;
private touziAudio: number;
startTouzi() {
let touzi_ani = pg.view.find(this, "touzi_ani");
let icon = pg.view.find(touzi_ani, "icon");
let touzi = icon.getComponent("touzi");
let hand = pg.view.find(touzi_ani, "hand");
let btn_stop = pg.view.find(touzi_ani, "btn_stop");
pg.view.visible(btn_stop, true);
pg.view.visible(touzi_ani, true);
touzi.startAni();
if (this.turnRobot) {
setTimeout(() => {
this.stopTouzi();
}, 300 + Math.random() * 200);
} else {
this.stopHandTimer = setTimeout(() => {
pg.view.visible(hand, true);
}, 5000);
}
pg.hw.playLocalAudio("touzi", true).then((id: number) => {
this.touziAudio = id;
})
}
//----------------------------OVER-------------------
gameOver() {
let state = pg.view.find(this, "state");
let bg_win = pg.view.find(state, "bg_win");
let bg_lose = pg.view.find(state, "bg_lose");
pg.view.visible(state, true);
if (this.playerPoint > this.robotPoint) {
pg.view.visible(bg_win, true);
pg.view.visible(bg_lose, false);
pg.hw.playLocalAudio("flower");
} else {
pg.view.visible(bg_win, false);
pg.view.visible(bg_lose, true);
}
setTimeout(() => {
pg.view.visible(bg_win, false);
pg.view.visible(bg_lose, false);
pg.event.emit("game_over");
}, 5000);
// onHomeworkFinish最后需要添加作业完成
onHomeworkFinish();
}
//-----------------------------TOOL-------------------------------
playLocalAudio(audioName) {
const audio = cc.find(`Canvas/res/audio/${audioName}`).getComponent(cc.AudioSource);
return new Promise((resolve, reject) => {
const id = cc.audioEngine.playEffect(audio.clip, false);
cc.audioEngine.setFinishCallback(id, () => {
resolve(id);
});
})
}
}
{
"ver": "1.0.8",
"uuid": "408a67f8-65fa-4cf1-8cf2-83e20e1a0fd5",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
......@@ -23,21 +23,11 @@ export default class NewClass extends cc.Component {
this.count = 0;
}
start() {
}
update(dt) {
this.count++;
// if (this.count >= 30) this.count = 0;
this.updateItems();
}
updateItems() {
let cur = Math.floor(this.count / 30) % 4
for (let i = 0; i < 4; i++) {
let item = pg.view.find(this, "btn_audio" + i);
item.active = cur == i;
}
}
}
{
"ver": "1.0.8",
"uuid": "bed01784-8114-4d5e-bd26-36345307676c",
"uuid": "764039ec-62e7-416b-a01b-1f8dd451a870",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
......@@ -59,9 +59,5 @@ export default class NewClass extends cc.Component {
});
return posArray;
}
start() {
}
// update (dt) {}
}
......@@ -22,12 +22,19 @@ export default class NewClass extends cc.Component {
this.showAni();
}
showAni() {
this.node.x += 400;
this.node.y -= 200;
cc.tween(this.node).by(0.3, { x: -400, y: 200 }).start();
setTimeout(() => {
this.showAni();
}, 2000);
if (this.node && this.node.active) {
this.node.x += 400;
this.node.y -= 200;
cc.tween(this.node).by(0.3, { x: -400, y: 200 }).call(() => {
setTimeout(() => {
this.showAni();
}, 1500);
}).start();
} else {
setTimeout(() => {
this.showAni();
}, 100);
}
}
update(dt) {
......
export default [
{ "id": "1", "yellow_x": "-480", "yellow_y": "70", "blue_x": "-345", "blue_y": "70", "type": "0", "value": "0" }, { "id": "2", "yellow_x": "-480", "yellow_y": "290", "blue_x": "-345", "blue_y": "135", "type": "1", "value": "blackboard" }, { "id": "3", "yellow_x": "-270", "yellow_y": "290", "blue_x": "-270", "blue_y": "135", "type": "1", "value": "window" }, { "id": "4", "yellow_x": "-130", "yellow_y": "290", "blue_x": "-130", "blue_y": "135", "type": "1", "value": "door" }, { "id": "5", "yellow_x": "-10", "yellow_y": "290", "blue_x": "-10", "blue_y": "135", "type": "2", "value": "2" }, { "id": "6", "yellow_x": "150", "yellow_y": "290", "blue_x": "150", "blue_y": "135", "type": "1", "value": "window" }, { "id": "7", "yellow_x": "300", "yellow_y": "290", "blue_x": "300", "blue_y": "135", "type": "5", "value": "14" }, { "id": "8", "yellow_x": "500", "yellow_y": "290", "blue_x": "370", "blue_y": "135", "type": "1", "value": "door" }, { "id": "9", "yellow_x": "500", "yellow_y": "70", "blue_x": "370", "blue_y": "70", "type": "3", "value": "1" }, { "id": "10", "yellow_x": "500", "yellow_y": "-70", "blue_x": "370", "blue_y": "-70", "type": "1", "value": "door" }, { "id": "11", "yellow_x": "500", "yellow_y": "-280", "blue_x": "370", "blue_y": "-125", "type": "1", "value": "blackboard" }, { "id": "12", "yellow_x": "290", "yellow_y": "-280", "blue_x": "290", "blue_y": "-125", "type": "1", "value": "window" }, { "id": "13", "yellow_x": "150", "yellow_y": "-280", "blue_x": "150", "blue_y": "-125", "type": "2", "value": "3" }, { "id": "14", "yellow_x": "10", "yellow_y": "-280", "blue_x": "10", "blue_y": "-125", "type": "1", "value": "blackboard" }, { "id": "15", "yellow_x": "-130", "yellow_y": "-280", "blue_x": "-130", "blue_y": "-125", "type": "2", "value": "1" }, { "id": "16", "yellow_x": "-270", "yellow_y": "-280", "blue_x": "-270", "blue_y": "-125", "type": "1", "value": "window" }, { "id": "17", "yellow_x": "-410", "yellow_y": "-280", "blue_x": "-410", "blue_y": "-125", "type": "4", "value": "5" }, { "id": "18", "yellow_x": "-550", "yellow_y": "-280", "blue_x": "-550", "blue_y": "-125", "type": "1", "value": "door" }, { "id": "19", "yellow_x": "-775", "yellow_y": "-280", "blue_x": "-600", "blue_y": "-125", "type": "1", "value": "blackboard" }, { "id": "20", "yellow_x": "-775", "yellow_y": "-55", "blue_x": "-600", "blue_y": "-55", "type": "1", "value": "window" }, { "id": "21", "yellow_x": "-775", "yellow_y": "80", "blue_x": "-600", "blue_y": "80", "type": "4", "value": "5" }, { "id": "22", "yellow_x": "-775", "yellow_y": "220", "blue_x": "-600", "blue_y": "220", "type": "2", "value": "3" }, { "id": "23", "yellow_x": "-775", "yellow_y": "365", "blue_x": "-600", "blue_y": "365", "type": "1", "value": "door" }, { "id": "24", "yellow_x": "-775", "yellow_y": "550", "blue_x": "-600", "blue_y": "420", "type": "2", "value": "5" }, { "id": "25", "yellow_x": "-550", "yellow_y": "550", "blue_x": "-550", "blue_y": "420", "type": "1", "value": "window" }, { "id": "26", "yellow_x": "-410", "yellow_y": "550", "blue_x": "-410", "blue_y": "420", "type": "4", "value": "5" }, { "id": "27", "yellow_x": "-270", "yellow_y": "550", "blue_x": "-270", "blue_y": "420", "type": "2", "value": "2" }, { "id": "28", "yellow_x": "-130", "yellow_y": "550", "blue_x": "-130", "blue_y": "420", "type": "1", "value": "door" }, { "id": "29", "yellow_x": "10", "yellow_y": "550", "blue_x": "10", "blue_y": "420", "type": "1", "value": "blackboard" }, { "id": "30", "yellow_x": "150", "yellow_y": "550", "blue_x": "150", "blue_y": "420", "type": "3", "value": "1" }, { "id": "31", "yellow_x": "290", "yellow_y": "550", "blue_x": "290", "blue_y": "420", "type": "1", "value": "window" }, { "id": "32", "yellow_x": "430", "yellow_y": "550", "blue_x": "430", "blue_y": "420", "type": "2", "value": "1" }, { "id": "33", "yellow_x": "570", "yellow_y": "550", "blue_x": "570", "blue_y": "420", "type": "4", "value": "5" }, { "id": "34", "yellow_x": "790", "yellow_y": "550", "blue_x": "630", "blue_y": "420", "type": "1", "value": "blackboard" }, { "id": "35", "yellow_x": "790", "yellow_y": "360", "blue_x": "630", "blue_y": "360", "type": "1", "value": "door" }, { "id": "36", "yellow_x": "790", "yellow_y": "215", "blue_x": "630", "blue_y": "215", "type": "2", "value": "3" }, { "id": "37", "yellow_x": "790", "yellow_y": "70", "blue_x": "630", "blue_y": "70", "type": "5", "value": "43" }, { "id": "38", "yellow_x": "790", "yellow_y": "-75", "blue_x": "630", "blue_y": "-75", "type": "3", "value": "1" }, { "id": "39", "yellow_x": "790", "yellow_y": "-220", "blue_x": "630", "blue_y": "-220", "type": "1", "value": "window" }, { "id": "40", "yellow_x": "790", "yellow_y": "-365", "blue_x": "630", "blue_y": "-365", "type": "2", "value": "1" }, { "id": "41", "yellow_x": "790", "yellow_y": "-550", "blue_x": "630", "blue_y": "-405", "type": "1", "value": "blackboard" }, { "id": "42", "yellow_x": "570", "yellow_y": "-550", "blue_x": "570", "blue_y": "-405", "type": "1", "value": "window" }, { "id": "43", "yellow_x": "430", "yellow_y": "-550", "blue_x": "430", "blue_y": "-405", "type": "2", "value": "2" }, { "id": "44", "yellow_x": "290", "yellow_y": "-550", "blue_x": "290", "blue_y": "-405", "type": "1", "value": "door" }, { "id": "45", "yellow_x": "150", "yellow_y": "-550", "blue_x": "150", "blue_y": "-405", "type": "4", "value": "5" }, { "id": "46", "yellow_x": "10", "yellow_y": "-550", "blue_x": "10", "blue_y": "-405", "type": "1", "value": "blackboard" }, { "id": "47", "yellow_x": "-130", "yellow_y": "-550", "blue_x": "-130", "blue_y": "-405", "type": "1", "value": "window" }, { "id": "48", "yellow_x": "-270", "yellow_y": "-550", "blue_x": "-270", "blue_y": "-405", "type": "1", "value": "door" }, { "id": "49", "yellow_x": "-410", "yellow_y": "-550", "blue_x": "-410", "blue_y": "-405", "type": "2", "value": "2" }, { "id": "50", "yellow_x": "-550", "yellow_y": "-550", "blue_x": "-550", "blue_y": "-405", "type": "1", "value": "blackboard" },
{ "id": "51", "yellow_x": "-690", "yellow_y": "-490", "blue_x": "-690", "blue_y": "-490", "type": "100", "value": "0" }]
\ No newline at end of file
{ "id": "51", "yellow_x": "-690", "yellow_y": "-490", "blue_x": "-690", "blue_y": "-490", "type": "100", "value": "0" }
]
\ No newline at end of file
......@@ -14,7 +14,8 @@ class Emitter {
return this;
}
on(event, fn) {
(this._callbacks[event] = this._callbacks[event] || []).push(fn);
if (!this._callbacks[event]) this._callbacks[event] = [];
this._callbacks[event].push(fn);
};
once(event, fn) {
function on() {
......@@ -208,7 +209,7 @@ let pg = {
if (!item) return pg.logger.w("图片更换失败,传入了错误的item");
let node = item.node ? item.node : item;
if (!res) {
node.active = false;
if (node) node.active = false;
return pg.logger.w("图片更换失败,传入了错误的res");
}
if (!node) return pg.logger.w("图片更换失败,传入了错误的item");
......
......@@ -31,7 +31,7 @@ export default class NewClass extends cc.Component {
pg.view.visible(icon_player_dice, true);
for (let i = 1; i <= 6; i++) {
let item = pg.view.find(icon_player_dice, "icon_" + i);
item.active = i == num;
pg.view.visible(item, i == num);
}
} else {
let icon_player = pg.view.find(this.player, "icon_player");
......@@ -48,7 +48,7 @@ export default class NewClass extends cc.Component {
pg.view.visible(icon_robot_dice, true);
for (let i = 1; i <= 6; i++) {
let item = pg.view.find(icon_robot_dice, "icon_" + i);
item.active = i == num;
pg.view.visible(item, i == num);
}
} else {
let icon_robot = pg.view.find(this.robot, "icon_robot");
......
......@@ -33,18 +33,19 @@ export default class NewClass extends cc.Component {
this.bg_goodjob = pg.view.find(this, "bg_goodjob");
this.bg_tryagain = pg.view.find(this, "bg_tryagain");
this.text_tip.active = false;
this.btn_audio_start.active = false;
this.btn_audio_stop.active = false;
this.speak_ske.active = false;
this.bg_goodjob.active = false;
this.bg_tryagain.active = false;
pg.view.visible(this.text_tip, false);
pg.view.visible(this.btn_audio_start, false);
pg.view.visible(this.btn_audio_stop, false);
pg.view.visible(this.speak_ske, false);
pg.view.visible(this.bg_goodjob, false);
pg.view.visible(this.bg_tryagain, false);
pg.view.touchOn(this.btn_audio_start, this.onTouchStart, this);
pg.view.touchOn(this.btn_audio_stop, this.onTouchStop, this);
this.tryCount = 0;
pg.event.on("speak_open", (data) => {
cc.log("speak_open");
this.tryCount = 0;
this.open(data)
})
......@@ -56,33 +57,33 @@ export default class NewClass extends cc.Component {
if (cell) {
this.val = cell.value;
}
this.text_tip.active = true;
this.btn_audio_start.active = true;
this.btn_audio_stop.active = false;
this.speak_ske.active = true;
this.bg_goodjob.active = false;
this.bg_tryagain.active = false;
pg.view.visible(this.text_tip, true);
pg.view.visible(this.btn_audio_start, true);
pg.view.visible(this.btn_audio_stop, false);
pg.view.visible(this.speak_ske, true);
pg.view.visible(this.bg_goodjob, false);
pg.view.visible(this.bg_tryagain, false);
}
close() {
this.text_tip.active = false;
this.btn_audio_start.active = false;
this.btn_audio_stop.active = false;
this.speak_ske.active = false;
this.bg_goodjob.active = false;
this.bg_tryagain.active = false;
pg.view.visible(this.text_tip, false);
pg.view.visible(this.btn_audio_start, false);
pg.view.visible(this.btn_audio_stop, false);
pg.view.visible(this.speak_ske, false);
pg.view.visible(this.bg_goodjob, false);
pg.view.visible(this.bg_tryagain, false);
}
onTouchStart() {
pg.view.playDBAnimation(this.speak_ske, "newAnimation", 0);
this.btn_audio_start.active = false;
this.btn_audio_stop.active = true;
pg.view.visible(this.btn_audio_start, false);
pg.view.visible(this.btn_audio_stop, true);
let win: any = window;
win.courseware && win.courseware.startTest(this.val); //开始录音
}
onTouchStop() {
this.btn_audio_start.active = false;
this.btn_audio_stop.active = false;
pg.view.visible(this.btn_audio_start, false);
pg.view.visible(this.btn_audio_stop, false);
let win: any = window;
if (!win.courseware) {
setTimeout(() => {
......@@ -118,25 +119,25 @@ export default class NewClass extends cc.Component {
}
onRealStop(score) {
pg.view.playDBAnimation(this.speak_ske, "newAnimation", 1);
this.text_tip.active = false;
this.btn_audio_start.active = false;
this.btn_audio_stop.active = false;
this.speak_ske.active = false;
this.bg_goodjob.active = false;
this.bg_tryagain.active = false;
pg.view.visible(this.text_tip, false);
pg.view.visible(this.btn_audio_start, false);
pg.view.visible(this.btn_audio_stop, false);
pg.view.visible(this.speak_ske, false);
pg.view.visible(this.bg_goodjob, false);
pg.view.visible(this.bg_tryagain, false);
setTimeout(() => {
// let score = Math.random() * 100 - 50;
pg.hw.playLocalAudio("goodjob");
if (score > 50) {
this.bg_goodjob.active = true;
pg.view.visible(this.bg_goodjob, true);
setTimeout(() => {
this.close();
pg.event.emit("speak_success");
}, 2000);
} else {
if (this.tryCount >= 1) {
this.bg_tryagain.active = true;
pg.view.visible(this.bg_tryagain, true);
pg.hw.playLocalAudio("tryagain");
this.tryCount++;
//需要处理提供两次机会。重置一次到open状态
......@@ -146,7 +147,7 @@ export default class NewClass extends cc.Component {
}, 2000);
} else {
this.bg_tryagain.active = true;
pg.view.visible(this.bg_tryagain, true);
pg.hw.playLocalAudio("tryagain");
this.tryCount++;
setTimeout(() => {
......
......@@ -30,8 +30,8 @@ export default class NewClass extends cc.Component {
let btn_start = pg.view.find(this, "btn_start");
let btn_restart = pg.view.find(this, "btn_restart");
let bg_vs = pg.view.find(this, "bg_vs");
panel_gray.active = true;
btn_start.active = true;
pg.view.visible(panel_gray, true);
pg.view.visible(btn_start, true);
}
onTouchStart() {
pg.hw.playLocalAudio("vs");
......@@ -39,13 +39,13 @@ export default class NewClass extends cc.Component {
let btn_start = pg.view.find(this, "btn_start");
let btn_restart = pg.view.find(this, "btn_restart");
let bg_vs = pg.view.find(this, "bg_vs");
panel_gray.active = true;
btn_start.active = false;
bg_vs.active = true;
pg.view.visible(panel_gray, true);
pg.view.visible(btn_start, false);
pg.view.visible(bg_vs, true);
pg.event.emit("game_start");
setTimeout(() => {
bg_vs.active = false;
panel_gray.active = false;
pg.view.visible(bg_vs, false);
pg.view.visible(panel_gray, false);
}, 2000);
}
onTouchRestart() {
......@@ -54,14 +54,14 @@ export default class NewClass extends cc.Component {
let btn_start = pg.view.find(this, "btn_start");
let btn_restart = pg.view.find(this, "btn_restart");
let bg_vs = pg.view.find(this, "bg_vs");
panel_gray.active = true;
btn_start.active = false;
btn_restart.active = false;
bg_vs.active = true;
pg.view.visible(panel_gray, true);
pg.view.visible(btn_start, false);
pg.view.visible(btn_restart, false);
pg.view.visible(bg_vs, true);
setTimeout(() => {
bg_vs.active = false;
panel_gray.active = false;
btn_restart.active = false;
pg.view.visible(bg_vs, false);
pg.view.visible(panel_gray, false);
pg.view.visible(btn_restart, false);
pg.event.emit("game_start");
}, 2000);
}
......@@ -69,8 +69,8 @@ export default class NewClass extends cc.Component {
let panel_gray = pg.view.find(this, "panel_gray");
let btn_restart = pg.view.find(this, "btn_restart");
let bg_vs = pg.view.find(this, "bg_vs");
panel_gray.active = true;
btn_restart.active = true;
pg.view.visible(panel_gray, true);
pg.view.visible(btn_restart, true);
}
update(dt) { }
}
......@@ -67,21 +67,22 @@ export default class NewClass extends cc.Component {
if (!number) return;
if (this.num) {
for (let i = 1; i <= 6; i++) {
this[`bg_${i}`].active = false;
pg.view.visible(this[`bg_${i}`], false)
}
for (let i = 1; i <= 6; i++) {
this[`bg_dice${i}`].active = i == number;
pg.view.visible(this[`bg_dice${i}`], i == number)
}
} else {
for (let i = 1; i <= 6; i++) {
this[`bg_${i}`].active = i == number;
pg.view.visible(this[`bg_${i}`], i == number)
}
for (let i = 1; i <= 6; i++) {
this[`bg_dice${i}`].active = false;
pg.view.visible(this[`bg_dice${i}`], false)
}
}
}
update(dt) {
if (!this.node || !this.node.active) return;
if (this.playing) {
let i = Math.floor(Math.random() * 6) + 1;
this.updatePoint(i);
......
......@@ -105,17 +105,17 @@ export class MyCocosSceneComponent extends cc.Component {
});
}
log (str) {
log(str) {
const node = cc.find('middleLayer');
if(node){
if (node) {
node.getComponent('middleLayer').log(str);
}else{
} else {
cc.log(str);
}
}
onLoadEnd() {
}
......@@ -132,7 +132,7 @@ export class MyCocosSceneComponent extends cc.Component {
// ------------------------------------------------
getSprNode(resName) {
const sf = cc.find('Canvas/res/img/' + resName).getComponent(cc.Sprite).spriteFrame;
......@@ -164,7 +164,7 @@ export class MyCocosSceneComponent extends cc.Component {
playAudioByUrl(audio_url, cb = null) {
if (audio_url) {
cc.assetManager.loadRemote(audio_url, (err, audioClip) => {
cc.assetManager.loadRemote(audio_url, (err, audioClip: any) => {
const audioId = cc.audioEngine.play(audioClip, false, 0.8);
if (cb) {
cc.audioEngine.setFinishCallback(audioId, () => {
......
......@@ -102,7 +102,7 @@ export function getDistance (start, end){
export function playAudioByUrl(audio_url, cb=null) {
if (audio_url) {
cc.assetManager.loadRemote(audio_url, (err, audioClip) => {
cc.assetManager.loadRemote(audio_url, (err, audioClip:any) => {
const audioId = cc.audioEngine.play(audioClip, false, 0.8);
if (cb) {
cc.audioEngine.setFinishCallback(audioId, () => {
......
const { spawn } = require("child_process");
const fs = require("fs");
const compressing = require('compressing');
const { v4, parse } = require('uuid');
const { Base64 } = require('js-base64');
const { copyDir, removeDir, fix2 } = require("./utils");
const { spawn } = require("child_process");
const fs = require("fs");
const compressing = require('compressing');
const { v4, parse } = require('uuid');
const { Base64 } = require('js-base64');
const { copyDir, removeDir, fix2 } = require("./utils");
async function buildForm() {
const paths = fs.readdirSync('form');
......@@ -52,7 +52,7 @@ function execCmd(cmd, params, path) {
}
let creatorBasePath = 'C:\\CocosDashboard_1.0.6\\resources\\.editors\\Creator\\2.4.5\\CocosCreator.exe';
let creatorBasePath = 'D:\\work\\CocosDashboard_1.0.9\\resources\\.editors\\Creator\\2.4.5\\CocosCreator.exe';
if (process.platform !== 'win32') {
creatorBasePath = "/Applications/CocosCreator/Creator/2.4.5/CocosCreator.app/Contents/MacOS/CocosCreator";
}
......@@ -128,10 +128,10 @@ async function buildWebBundle() {
await buildCocos(args);
}
function createConfigFile (projectName, type) {
function createConfigFile(projectName, type) {
let iosVersion = "";
let androidVersion = "";
if(!type){
if (!type) {
const androidPaths = fs.readdirSync(`dist/android/${projectName}`);
const androidConfigFileName = androidPaths.find(path => path.indexOf('config') == 0);
androidVersion = androidConfigFileName.split('.')[1];
......@@ -139,17 +139,17 @@ function createConfigFile (projectName, type) {
const iosConfigFileName = iosPaths.find(path => path.indexOf('config') == 0);
iosVersion = iosConfigFileName.split('.')[1];
} else {
if(type=="android"){
if (type == "android") {
const androidPaths = fs.readdirSync(`dist/android/${projectName}`);
const androidConfigFileName = androidPaths.find(path => path.indexOf('config') == 0);
androidVersion = androidConfigFileName.split('.')[1];
}else{
} else {
const iosPaths = fs.readdirSync(`dist/ios/${projectName}`);
const iosConfigFileName = iosPaths.find(path => path.indexOf('config') == 0);
iosVersion = iosConfigFileName.split('.')[1];
}
}
const config = {
"ios": {
"sceneName": projectName,
......@@ -164,7 +164,7 @@ function createConfigFile (projectName, type) {
fs.writeFileSync('dist/config.json', JSON.stringify(config));
}
function compressAll (projectName) {
function compressAll(projectName) {
const tarStream = new compressing.zip.Stream();
tarStream.addEntry('dist/play');
tarStream.addEntry('dist/form');
......@@ -176,7 +176,7 @@ function compressAll (projectName) {
tarStream.pipe(destStream);
}
function build_check () {
function build_check() {
const dirNames = process.cwd().split(/\/|\\/);
const projectName = dirNames[dirNames.length - 1];
const path = 'assets'
......@@ -211,20 +211,20 @@ function build_check () {
return projectName;
}
function changeSettingToWebDesktop () {
function changeSettingToWebDesktop() {
const path = 'assets'
const folderName = getFolderName(path);
editFolderMeta(path, folderName, false);
}
function changeSettingsToBundle () {
function changeSettingsToBundle() {
const path = 'assets'
const folderName = getFolderName(path);
editFolderMeta(path, folderName, true);
}
function replaceUuids () {
function replaceUuids() {
console.log('build_step_0 开始~!');
const path = 'assets'
......@@ -303,7 +303,7 @@ function replaceUuids () {
console.log('build_step_0 完成~!');
}
function replaceIndexHtml () {
function replaceIndexHtml() {
const data = fs.readFileSync('index.html');
fs.writeFileSync('dist/play/index.html', data);
}
......@@ -313,52 +313,52 @@ module.exports = {
build: async function () {
const startTime = new Date().getTime();
// 构建前检查
const projectName = build_check();
// 清理旧文件
// 构建form
await removeDir('dist/form');
await buildForm();
// 替换uuid
replaceUuids();
// 改设置为非bundle
changeSettingToWebDesktop();
// 构建play
await removeDir('dist/play');
await buildWebDesktop();
await copyDir('build/web-desktop', 'dist/play');
replaceIndexHtml();
console.log('构建 web desktop 成功!');
// 改设置为bundle
changeSettingsToBundle();
await removeDir('dist/android');
await buildAndroidBundle();
await copyDir('build_android/jsb-link/remote', 'dist/android');
console.log('构建 android bundle 成功!');
await removeDir('dist/ios');
await buildIosBundle();
await copyDir('build_ios/jsb-link/remote', 'dist/ios');
console.log('构建 ios bundle 成功!');
await removeDir('dist/web_desktop');
await buildWebBundle();
await copyDir(`build_web_desktop/web-desktop/assets/${projectName}`, 'dist/web_desktop');
console.log('构建 web bundle 成功!');
// 改设置为非bundle
changeSettingToWebDesktop();
createConfigFile(projectName);
compressAll(projectName);
await removeDir('build');
......@@ -380,11 +380,11 @@ module.exports = {
replaceUuids();
// 改设置为bundle
changeSettingsToBundle();
await removeDir('dist/android');
await buildAndroidBundle();
await copyDir('build_android/jsb-link/remote', 'dist/android');
// 改设置为非bundle
changeSettingToWebDesktop();
createConfigFile(projectName, "android");
......@@ -400,7 +400,7 @@ module.exports = {
replaceUuids();
// 改设置为bundle
changeSettingsToBundle();
await removeDir('dist/ios');
await buildIosBundle();
await copyDir('build_ios/jsb-link/remote', 'dist/ios');
......
{
"title": "play",
"packageName": "org.cocos2d.demo",
"startScene": "0737ce42-24f0-45c6-8e1a-8bdab4f74ba3",
"startScene": "2d2f792f-a40c-49bb-a189-ed176a246e49",
"excludeScenes": [],
"includeSDKBox": false,
"orientation": {
......@@ -28,7 +28,8 @@
},
"ios": {
"REMOTE_SERVER_ROOT": "",
"packageName": "org.cocos2d.demo"
"packageName": "org.cocos2d.demo",
"ios_enable_jit": true
},
"mac": {
"REMOTE_SERVER_ROOT": "",
......@@ -42,7 +43,7 @@
"width": 1280
},
"android-instant": {
"REMOTE_SERVER_ROOT": "",
"REMOTE_SERVER_ROOT": "http://192.168.43.126:7456/preview-android-instant/",
"host": "",
"packageName": "org.cocos2d.demo",
"pathPattern": "",
......@@ -50,5 +51,7 @@
"scheme": "https",
"skipRecord": false
},
"appBundle": false
"appBundle": false,
"agreements": {},
"includeAnySDK": false
}
{
"last-module-event-record-time": 1600677246969,
"last-module-event-record-time": 1640571810103,
"migrate-history": [
"cloud-function"
]
......
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