Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
comparetree
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
comparetree
Commits
7c2d2857
Commit
7c2d2857
authored
Jun 12, 2021
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
基础玩法完成,再核对一次需求,然后开始调整动画
parent
6945f6fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
362 additions
and
216 deletions
+362
-216
scene.fire
play/assets/scene/scene/scene.fire
+289
-168
scene.js
play/assets/scene/scene/scene.js
+73
-48
No files found.
play/assets/scene/scene/scene.fire
View file @
7c2d2857
...
...
@@ -87,10 +87,7 @@
"__id__": 20
},
{
"__id__": 50
},
{
"__id__": 67
"__id__": 53
},
{
"__id__": 70
...
...
@@ -99,52 +96,55 @@
"__id__": 73
},
{
"__id__": 7
4
"__id__": 7
6
},
{
"__id__": 7
5
"__id__": 7
7
},
{
"__id__": 7
7
"__id__": 7
8
},
{
"__id__": 8
3
"__id__": 8
0
},
{
"__id__":
9
6
"__id__":
8
6
},
{
"__id__":
122
"__id__":
99
},
{
"__id__": 12
4
"__id__": 12
5
},
{
"__id__": 12
6
"__id__": 12
7
},
{
"__id__": 12
8
"__id__": 12
9
},
{
"__id__": 13
0
"__id__": 13
1
},
{
"__id__": 13
2
"__id__": 13
3
},
{
"__id__": 134
"__id__": 135
},
{
"__id__": 137
}
],
"_active": true,
"_components": [
{
"__id__": 13
6
"__id__": 13
9
},
{
"__id__": 1
37
"__id__": 1
40
},
{
"__id__": 1
38
"__id__": 1
41
}
],
"_prefab": null,
...
...
@@ -1020,10 +1020,10 @@
"__id__": 41
},
{
"__id__": 4
6
"__id__": 4
9
},
{
"__id__":
48
"__id__":
51
}
],
"_active": true,
...
...
@@ -1992,6 +1992,9 @@
},
{
"__id__": 44
},
{
"__id__": 46
}
],
"_active": false,
...
...
@@ -2232,6 +2235,124 @@
"_atlas": null,
"_id": "c0Fp2hxP5Lf7vYluaP31SL"
},
{
"__type__": "cc.Node",
"_name": "txt",
"_objFlags": 0,
"_parent": {
"__id__": 41
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 47
},
{
"__id__": 48
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 149.38,
"height": 56.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-1.798,
4.552,
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": "94pUu7zdlM3JrMf1qZVXEx"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 46
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "Compare",
"_N$string": "Compare",
"_fontSize": 35,
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "c551970e-b095-45f3-9f1d-25cde8b8deb1"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "38wAsXpXhHaoiTefyKoQIX"
},
{
"__type__": "cc.LabelOutline",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 46
},
"_enabled": true,
"_color": {
"__type__": "cc.Color",
"r": 166,
"g": 60,
"b": 28,
"a": 255
},
"_width": 3,
"_id": "09DEDGjKlKuYmAY+UKFVUO"
},
{
"__type__": "cc.Node",
"_name": "box_0",
...
...
@@ -2243,7 +2364,7 @@
"_active": false,
"_components": [
{
"__id__":
47
"__id__":
50
}
],
"_prefab": null,
...
...
@@ -2299,7 +2420,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
6
"__id__": 4
9
},
"_enabled": true,
"_materials": [
...
...
@@ -2337,7 +2458,7 @@
"_active": false,
"_components": [
{
"__id__":
49
"__id__":
52
}
],
"_prefab": null,
...
...
@@ -2393,7 +2514,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
48
"__id__":
51
},
"_enabled": true,
"_materials": [
...
...
@@ -2429,10 +2550,10 @@
},
"_children": [
{
"__id__": 5
1
"__id__": 5
4
},
{
"__id__":
59
"__id__":
62
}
],
"_active": true,
...
...
@@ -2490,23 +2611,23 @@
"_name": "item",
"_objFlags": 0,
"_parent": {
"__id__": 5
0
"__id__": 5
3
},
"_children": [
{
"__id__": 5
2
"__id__": 5
5
},
{
"__id__": 5
4
"__id__": 5
7
},
{
"__id__": 5
6
"__id__": 5
9
}
],
"_active": false,
"_components": [
{
"__id__":
58
"__id__":
61
}
],
"_prefab": null,
...
...
@@ -2562,13 +2683,13 @@
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 5
1
"__id__": 5
4
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 5
3
"__id__": 5
6
}
],
"_prefab": null,
...
...
@@ -2624,7 +2745,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
2
"__id__": 5
5
},
"_enabled": true,
"_materials": [
...
...
@@ -2656,13 +2777,13 @@
"_name": "icon",
"_objFlags": 0,
"_parent": {
"__id__": 5
1
"__id__": 5
4
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 5
5
"__id__": 5
8
}
],
"_prefab": null,
...
...
@@ -2718,7 +2839,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
4
"__id__": 5
7
},
"_enabled": true,
"_materials": [
...
...
@@ -2750,13 +2871,13 @@
"_name": "txt",
"_objFlags": 0,
"_parent": {
"__id__": 5
1
"__id__": 5
4
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
57
"__id__":
60
}
],
"_prefab": null,
...
...
@@ -2812,7 +2933,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
6
"__id__": 5
9
},
"_enabled": true,
"_materials": [
...
...
@@ -2847,7 +2968,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
1
"__id__": 5
4
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -2908,7 +3029,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 5
1
"__id__": 5
4
},
"_id": "58IQ76yf1KT71BqZoNtHOV"
},
...
...
@@ -2917,23 +3038,23 @@
"_name": "item",
"_objFlags": 0,
"_parent": {
"__id__": 5
0
"__id__": 5
3
},
"_children": [
{
"__id__": 6
0
"__id__": 6
3
},
{
"__id__": 6
2
"__id__": 6
5
},
{
"__id__": 6
4
"__id__": 6
7
}
],
"_active": false,
"_components": [
{
"__id__": 6
6
"__id__": 6
9
}
],
"_prefab": null,
...
...
@@ -2989,13 +3110,13 @@
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__":
59
"__id__":
62
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 6
1
"__id__": 6
4
}
],
"_prefab": null,
...
...
@@ -3051,7 +3172,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
0
"__id__": 6
3
},
"_enabled": true,
"_materials": [
...
...
@@ -3083,13 +3204,13 @@
"_name": "icon",
"_objFlags": 0,
"_parent": {
"__id__":
59
"__id__":
62
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 6
3
"__id__": 6
6
}
],
"_prefab": null,
...
...
@@ -3145,7 +3266,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
2
"__id__": 6
5
},
"_enabled": true,
"_materials": [
...
...
@@ -3177,13 +3298,13 @@
"_name": "txt",
"_objFlags": 0,
"_parent": {
"__id__":
59
"__id__":
62
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 6
5
"__id__": 6
8
}
],
"_prefab": null,
...
...
@@ -3239,7 +3360,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
4
"__id__": 6
7
},
"_enabled": true,
"_materials": [
...
...
@@ -3274,7 +3395,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
59
"__id__":
62
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -3335,7 +3456,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__":
59
"__id__":
62
},
"_id": "7ayQ3f6atAS7c2pb2wuuAa"
},
...
...
@@ -3350,10 +3471,10 @@
"_active": false,
"_components": [
{
"__id__":
68
"__id__":
71
},
{
"__id__":
69
"__id__":
72
}
],
"_prefab": null,
...
...
@@ -3409,7 +3530,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
67
"__id__":
70
},
"_enabled": true,
"_materials": [
...
...
@@ -3441,7 +3562,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
67
"__id__":
70
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -3502,7 +3623,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__":
67
"__id__":
70
},
"_id": "86ErSTSUhP26kFUGhhqqPn"
},
...
...
@@ -3517,10 +3638,10 @@
"_active": true,
"_components": [
{
"__id__": 7
1
"__id__": 7
4
},
{
"__id__": 7
2
"__id__": 7
5
}
],
"_prefab": null,
...
...
@@ -3576,7 +3697,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
0
"__id__": 7
3
},
"_enabled": true,
"_layoutSize": {
...
...
@@ -3608,7 +3729,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
0
"__id__": 7
3
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -3757,7 +3878,7 @@
"_active": true,
"_components": [
{
"__id__": 7
6
"__id__": 7
9
}
],
"_prefab": null,
...
...
@@ -3813,7 +3934,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
5
"__id__": 7
8
},
"_enabled": true,
"_materials": [
...
...
@@ -3857,13 +3978,13 @@
},
"_children": [
{
"__id__":
78
"__id__":
81
}
],
"_active": true,
"_components": [
{
"__id__": 8
2
"__id__": 8
5
}
],
"_prefab": null,
...
...
@@ -3919,17 +4040,17 @@
"_name": "Star",
"_objFlags": 0,
"_parent": {
"__id__":
77
"__id__":
80
},
"_children": [
{
"__id__":
79
"__id__":
82
}
],
"_active": false,
"_components": [
{
"__id__": 8
1
"__id__": 8
4
}
],
"_prefab": null,
...
...
@@ -3985,13 +4106,13 @@
"_name": "StarBig",
"_objFlags": 0,
"_parent": {
"__id__":
78
"__id__":
81
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 8
0
"__id__": 8
3
}
],
"_prefab": null,
...
...
@@ -4047,7 +4168,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
79
"__id__":
82
},
"_enabled": true,
"_materials": [
...
...
@@ -4079,7 +4200,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
78
"__id__":
81
},
"_enabled": true,
"_materials": [
...
...
@@ -4111,7 +4232,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
77
"__id__":
80
},
"_enabled": true,
"_materials": [
...
...
@@ -4147,22 +4268,22 @@
},
"_children": [
{
"__id__": 8
4
"__id__": 8
7
},
{
"__id__": 8
6
"__id__": 8
9
},
{
"__id__":
88
"__id__":
91
},
{
"__id__": 9
0
"__id__": 9
3
},
{
"__id__": 9
2
"__id__": 9
5
},
{
"__id__": 9
4
"__id__": 9
7
}
],
"_active": true,
...
...
@@ -4220,13 +4341,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 8
3
"__id__": 8
6
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 8
5
"__id__": 8
8
}
],
"_prefab": null,
...
...
@@ -4282,7 +4403,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
4
"__id__": 8
7
},
"_enabled": true,
"_materials": [
...
...
@@ -4314,13 +4435,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 8
3
"__id__": 8
6
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
87
"__id__":
90
}
],
"_prefab": null,
...
...
@@ -4376,7 +4497,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
6
"__id__": 8
9
},
"_enabled": true,
"_materials": [
...
...
@@ -4408,13 +4529,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 8
3
"__id__": 8
6
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
89
"__id__":
92
}
],
"_prefab": null,
...
...
@@ -4470,7 +4591,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
88
"__id__":
91
},
"_enabled": true,
"_materials": [
...
...
@@ -4502,13 +4623,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 8
3
"__id__": 8
6
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
1
"__id__": 9
4
}
],
"_prefab": null,
...
...
@@ -4564,7 +4685,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
0
"__id__": 9
3
},
"_enabled": true,
"_materials": [
...
...
@@ -4596,13 +4717,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 8
3
"__id__": 8
6
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
3
"__id__": 9
6
}
],
"_prefab": null,
...
...
@@ -4658,7 +4779,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
2
"__id__": 9
5
},
"_enabled": true,
"_materials": [
...
...
@@ -4690,13 +4811,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 8
3
"__id__": 8
6
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
5
"__id__": 9
8
}
],
"_prefab": null,
...
...
@@ -4752,7 +4873,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
4
"__id__": 9
7
},
"_enabled": true,
"_materials": [
...
...
@@ -4788,19 +4909,19 @@
},
"_children": [
{
"__id__":
97
"__id__":
100
},
{
"__id__": 10
2
"__id__": 10
5
},
{
"__id__": 1
07
"__id__": 1
10
},
{
"__id__": 11
2
"__id__": 11
5
},
{
"__id__": 1
17
"__id__": 1
20
}
],
"_active": true,
...
...
@@ -4858,11 +4979,11 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__": 9
6
"__id__": 9
9
},
"_children": [
{
"__id__":
98
"__id__":
101
}
],
"_active": true,
...
...
@@ -4920,17 +5041,17 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__":
97
"__id__":
100
},
"_children": [
{
"__id__":
99
"__id__":
102
}
],
"_active": true,
"_components": [
{
"__id__": 10
1
"__id__": 10
4
}
],
"_prefab": null,
...
...
@@ -4986,13 +5107,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__":
98
"__id__":
101
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 10
0
"__id__": 10
3
}
],
"_prefab": null,
...
...
@@ -5048,7 +5169,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
99
"__id__":
102
},
"_enabled": true,
"_materials": [
...
...
@@ -5080,7 +5201,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
98
"__id__":
101
},
"_enabled": true,
"_materials": [
...
...
@@ -5102,11 +5223,11 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__": 9
6
"__id__": 9
9
},
"_children": [
{
"__id__": 10
3
"__id__": 10
6
}
],
"_active": true,
...
...
@@ -5164,17 +5285,17 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 10
2
"__id__": 10
5
},
"_children": [
{
"__id__": 10
4
"__id__": 10
7
}
],
"_active": true,
"_components": [
{
"__id__": 10
6
"__id__": 10
9
}
],
"_prefab": null,
...
...
@@ -5230,13 +5351,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 10
3
"__id__": 10
6
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 10
5
"__id__": 10
8
}
],
"_prefab": null,
...
...
@@ -5292,7 +5413,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
4
"__id__": 10
7
},
"_enabled": true,
"_materials": [
...
...
@@ -5324,7 +5445,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
3
"__id__": 10
6
},
"_enabled": true,
"_materials": [
...
...
@@ -5346,11 +5467,11 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__": 9
6
"__id__": 9
9
},
"_children": [
{
"__id__": 1
08
"__id__": 1
11
}
],
"_active": true,
...
...
@@ -5408,17 +5529,17 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 1
07
"__id__": 1
10
},
"_children": [
{
"__id__": 1
09
"__id__": 1
12
}
],
"_active": true,
"_components": [
{
"__id__": 11
1
"__id__": 11
4
}
],
"_prefab": null,
...
...
@@ -5474,13 +5595,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 1
08
"__id__": 1
11
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 11
0
"__id__": 11
3
}
],
"_prefab": null,
...
...
@@ -5536,7 +5657,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
09
"__id__": 1
12
},
"_enabled": true,
"_materials": [
...
...
@@ -5568,7 +5689,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
08
"__id__": 1
11
},
"_enabled": true,
"_materials": [
...
...
@@ -5590,11 +5711,11 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__": 9
6
"__id__": 9
9
},
"_children": [
{
"__id__": 11
3
"__id__": 11
6
}
],
"_active": true,
...
...
@@ -5652,17 +5773,17 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 11
2
"__id__": 11
5
},
"_children": [
{
"__id__": 11
4
"__id__": 11
7
}
],
"_active": true,
"_components": [
{
"__id__": 11
6
"__id__": 11
9
}
],
"_prefab": null,
...
...
@@ -5718,13 +5839,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 11
3
"__id__": 11
6
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 11
5
"__id__": 11
8
}
],
"_prefab": null,
...
...
@@ -5780,7 +5901,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
4
"__id__": 11
7
},
"_enabled": true,
"_materials": [
...
...
@@ -5812,7 +5933,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
3
"__id__": 11
6
},
"_enabled": true,
"_materials": [
...
...
@@ -5834,11 +5955,11 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__": 9
6
"__id__": 9
9
},
"_children": [
{
"__id__": 1
18
"__id__": 1
21
}
],
"_active": true,
...
...
@@ -5896,17 +6017,17 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 1
17
"__id__": 1
20
},
"_children": [
{
"__id__": 1
19
"__id__": 1
22
}
],
"_active": true,
"_components": [
{
"__id__": 12
1
"__id__": 12
4
}
],
"_prefab": null,
...
...
@@ -5962,13 +6083,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 1
18
"__id__": 1
21
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 12
0
"__id__": 12
3
}
],
"_prefab": null,
...
...
@@ -6024,7 +6145,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
19
"__id__": 1
22
},
"_enabled": true,
"_materials": [
...
...
@@ -6056,7 +6177,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
18
"__id__": 1
21
},
"_enabled": true,
"_materials": [
...
...
@@ -6084,7 +6205,7 @@
"_active": true,
"_components": [
{
"__id__": 12
3
"__id__": 12
6
}
],
"_prefab": null,
...
...
@@ -6140,7 +6261,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
2
"__id__": 12
5
},
"_enabled": true,
"_clip": {
...
...
@@ -6165,7 +6286,7 @@
"_active": true,
"_components": [
{
"__id__": 12
5
"__id__": 12
8
}
],
"_prefab": null,
...
...
@@ -6221,7 +6342,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
4
"__id__": 12
7
},
"_enabled": true,
"_clip": {
...
...
@@ -6246,7 +6367,7 @@
"_active": true,
"_components": [
{
"__id__": 1
27
"__id__": 1
30
}
],
"_prefab": null,
...
...
@@ -6302,7 +6423,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
6
"__id__": 12
9
},
"_enabled": true,
"_clip": {
...
...
@@ -6327,7 +6448,7 @@
"_active": true,
"_components": [
{
"__id__": 1
29
"__id__": 1
32
}
],
"_prefab": null,
...
...
@@ -6383,7 +6504,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
28
"__id__": 1
31
},
"_enabled": true,
"_clip": {
...
...
@@ -6408,7 +6529,7 @@
"_active": true,
"_components": [
{
"__id__": 13
1
"__id__": 13
4
}
],
"_prefab": null,
...
...
@@ -6464,7 +6585,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
0
"__id__": 13
3
},
"_enabled": true,
"_clip": {
...
...
@@ -6489,7 +6610,7 @@
"_active": true,
"_components": [
{
"__id__": 13
3
"__id__": 13
6
}
],
"_prefab": null,
...
...
@@ -6545,7 +6666,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
2
"__id__": 13
5
},
"_enabled": true,
"_clip": {
...
...
@@ -6570,7 +6691,7 @@
"_active": true,
"_components": [
{
"__id__": 13
5
"__id__": 13
8
}
],
"_prefab": null,
...
...
@@ -6626,7 +6747,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
4
"__id__": 13
7
},
"_enabled": true,
"_clip": {
...
...
play/assets/scene/scene/scene.js
View file @
7c2d2857
...
...
@@ -137,55 +137,7 @@ cc.Class({
this
.
initSingleData
();
this
.
initAudio
();
this
.
initView
();
// this.initButton();
},
initButton
()
{
//触碰判断
let
item
=
pg
.
view
.
find
(
this
,
"
items/item
"
);
item
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
onStartItem
,
this
);
item
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onEndItem
,
this
);
item
.
on
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
,
this
.
onMoveItem
,
this
);
item
.
on
(
cc
.
Node
.
EventType
.
TOUCH_CANCEL
,
this
.
onCancelItem
,
this
);
},
onStartItem
(
touch
)
{
this
.
_startPos
=
cc
.
v2
(
touch
.
target
.
x
,
touch
.
target
.
y
);
let
touchPos
=
touch
.
getLocation
();
touch
.
target
.
x
=
touchPos
.
x
-
1280
/
2
;
touch
.
target
.
y
=
touchPos
.
y
-
720
/
2
;
},
onEndItem
(
touch
)
{
let
box_0
=
pg
.
view
.
find
(
this
,
"
box/box_0
"
);
//检测碰撞
if
(
this
.
checkCollider
(
touch
.
target
,
box_0
))
{
}
else
{
//碰撞失败退回原位置
touch
.
target
.
x
=
this
.
_startPos
.
x
;
touch
.
target
.
y
=
this
.
_startPos
.
y
;
}
},
onMoveItem
(
touch
)
{
//获取到的location是 当前点击的位置 而不是按钮原本应该所在的位置。
let
touchPos
=
touch
.
getLocation
();
touch
.
target
.
x
=
touchPos
.
x
-
1280
/
2
;
touch
.
target
.
y
=
touchPos
.
y
-
720
/
2
;
},
onCancelItem
(
touch
)
{
console
.
log
(
touch
);
},
checkCollider
(
item
,
box
)
{
return
item
.
x
>
box
.
x
-
box
.
width
/
2
&&
item
.
x
<
box
.
x
+
box
.
width
/
2
&&
item
.
y
>
box
.
y
-
box
.
height
/
2
&&
item
.
y
<
box
.
y
+
box
.
height
/
2
;
},
...
...
@@ -268,16 +220,20 @@ cc.Class({
let
addX
=
190
;
let
y
=
75
;
for
(
let
i
=
0
;
i
<
sonleis
.
length
;
i
++
)
{
let
data
=
sonleis
[
i
];
let
sonClone
=
cc
.
instantiate
(
son
);
sonClone
.
active
=
true
;
let
posX
=
x
+
addX
*
i
;
let
posY
=
y
;
sonClone
.
x
=
posX
;
sonClone
.
y
=
posY
;
sonClone
.
data
=
data
;
pg
.
view
.
setString
(
pg
.
view
.
find
(
sonClone
,
"
txt
"
),
data
.
title
);
box
.
addChild
(
sonClone
);
}
},
initBox
()
{
this
.
_boxItems
=
[];
//刷新子类
let
son
=
pg
.
view
.
find
(
this
,
"
box/box_0
"
);
let
box
=
pg
.
view
.
find
(
this
,
"
box
"
);
...
...
@@ -289,12 +245,15 @@ cc.Class({
let
y
=
-
62
;
for
(
let
i
=
0
;
i
<
sonleis
.
length
;
i
++
)
{
let
sonClone
=
cc
.
instantiate
(
son
);
let
data
=
sonleis
[
i
];
sonClone
.
data
=
data
;
sonClone
.
active
=
true
;
let
posX
=
x
+
addX
*
i
;
let
posY
=
y
;
sonClone
.
x
=
posX
;
sonClone
.
y
=
posY
;
box
.
addChild
(
sonClone
);
this
.
_boxItems
.
push
(
sonClone
);
}
},
initItems
()
{
...
...
@@ -309,11 +268,14 @@ cc.Class({
let
addY
=
-
90
;
for
(
let
i
=
0
;
i
<
sonleis
.
length
;
i
++
)
{
let
sonClone
=
cc
.
instantiate
(
son
);
let
data
=
sonleis
[
i
];
sonClone
.
data
=
data
;
sonClone
.
active
=
true
;
let
posX
=
x
+
addX
*
(
i
%
7
);
let
posY
=
y
+
addY
*
Math
.
floor
(
i
/
7
);
sonClone
.
x
=
posX
;
sonClone
.
y
=
posY
;
this
.
initButton
(
sonClone
);
box
.
addChild
(
sonClone
);
}
}
else
{
...
...
@@ -325,6 +287,8 @@ cc.Class({
let
arr
=
[
3
,
4
,
5
,
6
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
,
24
,
25
,
26
,
27
,
28
,
29
,
30
];
for
(
let
i
=
0
;
i
<
sonleis
.
length
;
i
++
)
{
let
sonClone
=
cc
.
instantiate
(
son
);
let
data
=
sonleis
[
i
];
sonClone
.
data
=
data
;
sonClone
.
active
=
true
;
let
posX
=
x
+
addX
*
(
arr
[
i
]
%
10
);
let
posY
=
y
+
addY
*
Math
.
floor
(
arr
[
i
]
/
10
);
...
...
@@ -332,11 +296,72 @@ cc.Class({
sonClone
.
y
=
posY
;
sonClone
.
scaleX
=
scale
;
sonClone
.
scaleY
=
scale
;
this
.
initButton
(
sonClone
);
box
.
addChild
(
sonClone
);
}
}
},
initButton
(
item
)
{
item
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
onStartItem
,
this
);
item
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onEndItem
,
this
);
item
.
on
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
,
this
.
onMoveItem
,
this
);
item
.
on
(
cc
.
Node
.
EventType
.
TOUCH_CANCEL
,
this
.
onCancelItem
,
this
);
},
onStartItem
(
touch
)
{
this
.
_startPos
=
cc
.
v2
(
touch
.
target
.
x
,
touch
.
target
.
y
);
let
touchPos
=
touch
.
getLocation
();
touch
.
target
.
x
=
touchPos
.
x
-
1280
/
2
;
touch
.
target
.
y
=
touchPos
.
y
-
720
/
2
;
},
onEndItem
(
touch
)
{
//检测碰撞
let
box
=
this
.
getCollider
(
touch
.
target
);
if
(
box
)
{
//成功 失败的判断 根据id
let
successed
=
box
.
data
.
child
.
some
(
dt
=>
dt
.
cardId
==
touch
.
target
.
data
.
cardId
);
if
(
successed
)
{
alert
(
"
成功
"
)
}
else
{
alert
(
"
失败
"
)
//碰撞失败退回原位置
touch
.
target
.
x
=
this
.
_startPos
.
x
;
touch
.
target
.
y
=
this
.
_startPos
.
y
;
}
}
else
{
//碰撞失败退回原位置
touch
.
target
.
x
=
this
.
_startPos
.
x
;
touch
.
target
.
y
=
this
.
_startPos
.
y
;
}
},
onMoveItem
(
touch
)
{
//获取到的location是 当前点击的位置 而不是按钮原本应该所在的位置。
let
touchPos
=
touch
.
getLocation
();
touch
.
target
.
x
=
touchPos
.
x
-
1280
/
2
;
touch
.
target
.
y
=
touchPos
.
y
-
720
/
2
;
},
onCancelItem
(
touch
)
{
console
.
log
(
touch
);
},
getCollider
(
item
)
{
for
(
let
i
=
0
;
i
<
this
.
_boxItems
.
length
;
i
++
)
{
if
(
this
.
checkCollider
(
item
,
this
.
_boxItems
[
i
]))
return
this
.
_boxItems
[
i
];
}
return
null
;
},
checkCollider
(
item
,
box
)
{
return
item
.
x
>
box
.
x
-
box
.
width
/
2
&&
item
.
x
<
box
.
x
+
box
.
width
/
2
&&
item
.
y
>
box
.
y
-
box
.
height
/
2
&&
item
.
y
<
box
.
y
+
box
.
height
/
2
;
},
// updateItem(item, data) {
// let img = pg.view.find(item, `img`);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment