Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
unit_demo
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
unit_demo
Commits
420775d8
Commit
420775d8
authored
Mar 18, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 增加星星飞行效果
parent
ff4cde55
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1222 additions
and
74 deletions
+1222
-74
demo_02_scoreStars.fire
play/assets/tmpGame/scene/demo_02_scoreStars.fire
+1065
-59
demo_02_scoreStars.js
play/assets/tmpGame/scene/demo_02_scoreStars.js
+85
-15
icon_bigstar.png
play/assets/tmpGame/textures/icon_bigstar.png
+0
-0
icon_bigstar.png.meta
play/assets/tmpGame/textures/icon_bigstar.png.meta
+36
-0
icon_star.png
play/assets/tmpGame/textures/icon_star.png
+0
-0
icon_star.png.meta
play/assets/tmpGame/textures/icon_star.png.meta
+36
-0
No files found.
play/assets/tmpGame/scene/demo_02_scoreStars.fire
View file @
420775d8
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
"__id__": 2
"__id__": 2
},
},
{
{
"__id__":
11
"__id__":
27
}
}
],
],
"_active": true,
"_active": true,
...
@@ -76,18 +76,24 @@
...
@@ -76,18 +76,24 @@
},
},
{
{
"__id__": 5
"__id__": 5
},
{
"__id__": 8
},
{
"__id__": 16
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
8
"__id__":
24
},
},
{
{
"__id__":
9
"__id__":
25
},
},
{
{
"__id__":
10
"__id__":
26
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -361,71 +367,93 @@
...
@@ -361,71 +367,93 @@
"_id": "d7gnmxSWJPV4wGWih5+7Hx"
"_id": "d7gnmxSWJPV4wGWih5+7Hx"
},
},
{
{
"__type__": "cc.
Canvas
",
"__type__": "cc.
Node
",
"_name": "",
"_name": "
BtnShowStar
",
"_objFlags": 0,
"_objFlags": 0,
"
node
": {
"
_parent
": {
"__id__": 2
"__id__": 2
},
},
"_enabled": true,
"_children": [
"_designResolution": {
{
"__id__": 9
}
],
"_active": true,
"_components": [
{
"__id__": 14
},
{
"__id__": 15
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width":
96
0,
"width":
10
0,
"height":
6
40
"height": 40
},
},
"_fitWidth": false,
"_anchorPoint": {
"_fitHeight": true,
"__type__": "cc.Vec2",
"_id": "59Cd0ovbdF4byw5sbjJDx7"
"x": 0.5,
},
"y": 0.5
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
},
"_enabled": true,
"_trs": {
"alignMode": 1,
"__type__": "TypedArray",
"_target": null,
"ctor": "Float64Array",
"_alignFlags": 45,
"array": [
"_left": 0,
200,
"_right": 0,
-270,
"_top": 0,
0,
"_bottom": 0,
0,
"_verticalCenter": 0,
0,
"_horizontalCenter": 0,
0,
"_isAbsLeft": true,
1,
"_isAbsRight": true,
1,
"_isAbsTop": true,
1,
"_isAbsBottom": true,
1
"_isAbsHorizontalCenter": true,
]
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "29zXboiXFBKoIV4PQ2liTe"
},
{
"__type__": "52c4dVvmxZDkr2ojYl0ZDZW",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
},
"_enabled": true,
"_eulerAngles": {
"_id": "e1/+u9dO9NBJk48O/QUQdP"
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "1dJvlXTo9NSpvfMQHJ7D8m"
},
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "
Star
",
"_name": "
Background
",
"_objFlags":
0
,
"_objFlags":
512
,
"_parent": {
"_parent": {
"__id__":
1
"__id__":
8
},
},
"_children": [],
"_children": [
{
"__id__": 10
}
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 12
"__id__": 12
},
{
"__id__": 13
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -439,8 +467,8 @@
...
@@ -439,8 +467,8 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width":
62
,
"width":
100
,
"height":
66
"height":
40
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -451,8 +479,8 @@
...
@@ -451,8 +479,8 @@
"__type__": "TypedArray",
"__type__": "TypedArray",
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
-112.71
,
0
,
-100.737
,
0
,
0,
0,
0,
0,
0,
0,
...
@@ -474,14 +502,992 @@
...
@@ -474,14 +502,992 @@
"_is3DNode": false,
"_is3DNode": false,
"_groupIndex": 0,
"_groupIndex": 0,
"groupIndex": 0,
"groupIndex": 0,
"_id": "caYUJQLsRA5raLY3euWf0C"
"_id": "d1o3DwgQJOA731lniEE8ch"
},
{
"__type__": "cc.Node",
"_name": "Label",
"_objFlags": 512,
"_parent": {
"__id__": 9
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 11
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 40
},
"_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": "b9XwNjhRFDQ484uhJJDHKa"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_useOriginalSize": false,
"_string": "播放",
"_N$string": "播放",
"_fontSize": 20,
"_lineHeight": 40,
"_enableWrapText": false,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 1,
"_N$cacheMode": 1,
"_id": "77QON6XRxLWbPlcJmOVdfp"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"_type": 1,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "73VqOCOstGeIWvE3JqS/V7"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
},
"_enabled": true,
"alignMode": 0,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 40,
"_id": "071bHfRGxKUrsYWhCAdWe/"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 2,
"transition": 2,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 230,
"g": 230,
"b": 230,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 200,
"g": 200,
"b": 200,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 200,
"g": 200,
"b": 200,
"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": 120,
"g": 120,
"b": 120,
"a": 200
},
"_N$normalSprite": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"_N$pressedSprite": {
"__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a"
},
"pressedSprite": {
"__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a"
},
"_N$hoverSprite": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"hoverSprite": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"_N$disabledSprite": {
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
},
"_N$target": {
"__id__": 9
},
"_id": "9eXZnPPItIwaJ6QyH6KKd/"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 20,
"_left": 0,
"_right": 213,
"_top": 0,
"_bottom": 30,
"_verticalCenter": 0,
"_horizontalCenter": 200,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "953bIyAnlI8Li4AkmntVgA"
},
{
"__type__": "cc.Node",
"_name": "BtnAddStar",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 17
}
],
"_active": true,
"_components": [
{
"__id__": 22
},
{
"__id__": 23
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 40
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-200,
-270,
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": "0ceHmZk1hGO4j0cKMB8KsG"
},
{
"__type__": "cc.Node",
"_name": "Background",
"_objFlags": 512,
"_parent": {
"__id__": 16
},
"_children": [
{
"__id__": 18
}
],
"_active": true,
"_components": [
{
"__id__": 20
},
{
"__id__": 21
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 40
},
"_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": "83JdtqpLhIsoN6oCCXXi1H"
},
{
"__type__": "cc.Node",
"_name": "Label",
"_objFlags": 512,
"_parent": {
"__id__": 17
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 19
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 40
},
"_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": "d57GBcQSpCi6cec1I7sN8j"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 18
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_useOriginalSize": false,
"_string": "增加星星",
"_N$string": "增加星星",
"_fontSize": 20,
"_lineHeight": 40,
"_enableWrapText": false,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 1,
"_N$cacheMode": 1,
"_id": "bdtX88qdFJsJyQtT9jmZMT"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 17
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"_type": 1,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "baaIwLupVGqatQGUxpQOkO"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 17
},
"_enabled": true,
"alignMode": 0,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 40,
"_id": "97S5yj4PhCVI5UFMrd//gL"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 16
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 2,
"transition": 2,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 230,
"g": 230,
"b": 230,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 200,
"g": 200,
"b": 200,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 200,
"g": 200,
"b": 200,
"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": 120,
"g": 120,
"b": 120,
"a": 200
},
"_N$normalSprite": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"_N$pressedSprite": {
"__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a"
},
"pressedSprite": {
"__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a"
},
"_N$hoverSprite": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"hoverSprite": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"_N$disabledSprite": {
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
},
"_N$target": {
"__id__": 17
},
"_id": "175x0yGZhMuYnDccKEjZC+"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 16
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 20,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 30,
"_verticalCenter": 0,
"_horizontalCenter": -200,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "28REOmxdtFIYG6KHBo6VmY"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 960,
"height": 640
},
"_fitWidth": false,
"_fitHeight": true,
"_id": "59Cd0ovbdF4byw5sbjJDx7"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "29zXboiXFBKoIV4PQ2liTe"
},
{
"__type__": "52c4dVvmxZDkr2ojYl0ZDZW",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_id": "e1/+u9dO9NBJk48O/QUQdP"
},
{
"__type__": "cc.Node",
"_name": "StarBase",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 28
}
],
"_active": true,
"_components": [
{
"__id__": 32
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 62,
"height": 66
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-193.71,
-148.737,
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": "caYUJQLsRA5raLY3euWf0C"
},
{
"__type__": "cc.Node",
"_name": "Star",
"_objFlags": 0,
"_parent": {
"__id__": 27
},
"_children": [
{
"__id__": 29
}
],
"_active": false,
"_components": [
{
"__id__": 31
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 62,
"height": 69
},
"_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": "1ei0HhhfNI55S64CkxHS+5"
},
{
"__type__": "cc.Node",
"_name": "StarBig",
"_objFlags": 0,
"_parent": {
"__id__": 28
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 30
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 278,
"height": 275
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
-0.7071067811865475,
0.7071067811865476,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": -90
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "3f7u5hhEZJvaLGSJYAKli0"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 29
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "b00d89ac-54ee-4b06-878a-acef8c97f0df"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "aebDpLzF5N5aVHTOPJ56UN"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 28
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "f72965fe-cf21-4551-adcb-6bdc04be67a0"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "0civ9QyulAUbDVzlMv7XVa"
},
},
{
{
"__type__": "cc.Sprite",
"__type__": "cc.Sprite",
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
11
"__id__":
27
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
...
play/assets/tmpGame/scene/demo_02_scoreStars.js
View file @
420775d8
...
@@ -11,27 +11,97 @@ cc.Class({
...
@@ -11,27 +11,97 @@ cc.Class({
properties
:
{
properties
:
{
},
},
start
()
{
start
()
{
this
.
initListeners
();
},
initListeners
()
{
const
BtnAddStar
=
cc
.
find
(
'
Canvas/BtnAddStar
'
);
BtnAddStar
.
on
(
'
click
'
,
this
.
addStar
.
bind
(
this
));
const
BtnShowStar
=
cc
.
find
(
'
Canvas/BtnShowStar
'
);
BtnShowStar
.
on
(
'
click
'
,
this
.
showStar
.
bind
(
this
));
},
let
length
=
0
;
length
,
setInterval
(()
=>
{
addStar
()
{
const
starLayout
=
cc
.
find
(
'
Canvas/layout
'
);
if
(
!
this
.
length
)
{
starLayout
.
removeAllChildren
();
this
.
length
=
0
;
const
paddingY
=
starLayout
.
getComponent
(
cc
.
Layout
).
spacingY
;
}
this
.
length
++
;
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
let
length
=
this
.
length
;
const
star
=
cc
.
instantiate
(
cc
.
find
(
'
Star
'
));
star
.
name
=
`star_
${
i
}
`
;
const
starLayout
=
cc
.
find
(
'
Canvas/layout
'
);
star
.
scale
=
this
.
Between
(
0.5
,
1
,
(
starLayout
.
height
/
length
-
paddingY
)
/
star
.
height
);
starLayout
.
removeAllChildren
();
star
.
parent
=
starLayout
;
const
paddingY
=
starLayout
.
getComponent
(
cc
.
Layout
).
spacingY
;
}
length
++
;
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
},
1000
);
const
starBase
=
cc
.
instantiate
(
cc
.
find
(
'
StarBase
'
));
starBase
.
name
=
`starBase_
${
i
}
`
;
starBase
.
scale
=
this
.
Between
(
0.5
,
(
starLayout
.
height
/
length
-
paddingY
)
/
starBase
.
height
,
1
);
starBase
.
parent
=
starLayout
;
}
this
.
currentStarIdx
=
0
;
},
currentStarIdx
:
null
,
showStar
()
{
if
(
!
this
.
currentStarIdx
)
{
this
.
currentStarIdx
=
0
;
}
const
starBase
=
cc
.
find
(
`Canvas/layout/starBase_
${
this
.
currentStarIdx
}
`
);
if
(
!
starBase
)
{
return
;
}
const
star
=
starBase
.
getChildByName
(
'
Star
'
);
const
starBig
=
star
.
getChildByName
(
'
StarBig
'
);
starBig
.
scale
=
1
;
star
.
active
=
true
;
star
.
scaleX
=
0.7
/
starBase
.
scale
;
star
.
scaleY
=
1
/
starBase
.
scale
;
star
.
angle
=
90
;
const
canvas
=
cc
.
find
(
'
Canvas
'
);
const
startPos
=
this
.
exchangeNodePos
(
star
.
parent
,
canvas
,
cc
.
v2
(
0
,
-
canvas
.
height
/
2
));
const
middlePos
=
this
.
exchangeNodePos
(
star
.
parent
,
canvas
,
cc
.
v2
(
0
,
-
canvas
.
height
/
4
));
star
.
x
=
startPos
.
x
;
star
.
y
=
startPos
.
y
-
starBig
.
height
;
console
.
log
(
'
middlePos =
'
+
JSON
.
stringify
(
middlePos
));
const
time
=
1
;
cc
.
tween
(
star
)
.
to
(
0.3
,
{
y
:
middlePos
.
y
+
80
},
{
easing
:
'
quadOut
'
})
.
to
(
0.1
,
{
y
:
middlePos
.
y
+
40
,
scaleX
:
1.2
/
starBase
.
scale
,
scaleY
:
0.8
/
starBase
.
scale
},
{
easing
:
'
quadOut
'
})
.
to
(
0.1
,
{
y
:
middlePos
.
y
,
scaleX
:
1
/
starBase
.
scale
,
scaleY
:
1
/
starBase
.
scale
},
{
easing
:
'
quadOut
'
})
.
delay
(
0.1
)
.
to
(
0.8
,
{
angle
:
-
720
,
scale
:
1
})
.
start
();
cc
.
tween
(
star
)
.
delay
(
0.6
)
.
to
(
0.8
,
{
x
:
0
},
{
easing
:
'
quadIn
'
})
.
start
();
cc
.
tween
(
star
)
.
delay
(
0.6
)
.
to
(
0.8
,
{
y
:
0
},
{
easing
:
'
quadOut
'
})
.
start
();
cc
.
tween
(
starBig
)
.
delay
(
0.6
)
.
to
(
0.8
,
{
scale
:
0
},
{
easing
:
'
quadOut
'
})
.
call
(()
=>
{
// this.checkGameEnd();
})
.
start
();
this
.
currentStarIdx
++
;
},
},
Between
(
a
,
b
,
c
)
{
Between
(
a
,
b
,
c
)
{
return
[
a
,
b
,
c
].
sort
()[
1
];
return
[
a
,
b
,
c
].
sort
()[
1
];
},
},
exchangeNodePos
(
targetNode
,
baseNode
,
basePos
)
{
return
targetNode
.
convertToNodeSpaceAR
(
baseNode
.
convertToWorldSpaceAR
(
cc
.
v2
(
basePos
.
x
,
basePos
.
y
)));
},
});
});
play/assets/tmpGame/textures/icon_bigstar.png
0 → 100644
View file @
420775d8
14.5 KB
play/assets/tmpGame/textures/icon_bigstar.png.meta
0 → 100644
View file @
420775d8
{
"ver": "2.3.5",
"uuid": "f52d3699-7f54-4afe-ae7e-57ed7fb43ba7",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 278,
"height": 275,
"platformSettings": {},
"subMetas": {
"icon_bigstar": {
"ver": "1.0.4",
"uuid": "b00d89ac-54ee-4b06-878a-acef8c97f0df",
"rawTextureUuid": "f52d3699-7f54-4afe-ae7e-57ed7fb43ba7",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 278,
"height": 275,
"rawWidth": 278,
"rawHeight": 275,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
play/assets/tmpGame/textures/icon_star.png
0 → 100644
View file @
420775d8
3.61 KB
play/assets/tmpGame/textures/icon_star.png.meta
0 → 100644
View file @
420775d8
{
"ver": "2.3.5",
"uuid": "a3af0e38-26ac-48a5-b033-cdb020817fc9",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 62,
"height": 69,
"platformSettings": {},
"subMetas": {
"icon_star": {
"ver": "1.0.4",
"uuid": "f72965fe-cf21-4551-adcb-6bdc04be67a0",
"rawTextureUuid": "a3af0e38-26ac-48a5-b033-cdb020817fc9",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 62,
"height": 69,
"rawWidth": 62,
"rawHeight": 69,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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