Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cake_class_1
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
cake_class_1
Commits
8a232f22
Commit
8a232f22
authored
Mar 15, 2022
by
章红平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
63aa9365
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
236 additions
and
120 deletions
+236
-120
panel.prefab
assets/cake_class_1/prefab/panel.prefab
+193
-93
cake_class_1.fire
assets/cake_class_1/scene/cake_class_1.fire
+3
-3
cake_class_1.ts
assets/cake_class_1/scene/cake_class_1.ts
+17
-11
panel.ts
assets/cake_class_1/script/panel.ts
+23
-13
No files found.
assets/cake_class_1/prefab/panel.prefab
View file @
8a232f22
...
@@ -19,22 +19,16 @@
...
@@ -19,22 +19,16 @@
"_children": [
"_children": [
{
{
"__id__": 2
"__id__": 2
},
{
"__id__": 30
},
{
"__id__": 39
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 5
0
"__id__": 5
3
}
}
],
],
"_prefab": {
"_prefab": {
"__id__": 5
1
"__id__": 5
4
},
},
"_opacity": 255,
"_opacity": 255,
"_color": {
"_color": {
...
@@ -105,12 +99,18 @@
...
@@ -105,12 +99,18 @@
},
},
{
{
"__id__": 18
"__id__": 18
},
{
"__id__": 29
},
{
"__id__": 41
}
}
],
],
"_active": true,
"_active": true,
"_components": [],
"_components": [],
"_prefab": {
"_prefab": {
"__id__":
29
"__id__":
52
},
},
"_opacity": 255,
"_opacity": 255,
"_color": {
"_color": {
...
@@ -1130,40 +1130,95 @@
...
@@ -1130,40 +1130,95 @@
"fileId": "d4Kv2wUZJFTLmcAae9Ch7c",
"fileId": "d4Kv2wUZJFTLmcAae9Ch7c",
"sync": false
"sync": false
},
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "3d36363e-8b0c-4b06-9192-bfffb9ed35bf"
},
"fileId": "91Q8ta16tPfYNnewRrj3HT",
"sync": false
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "block",
"_name": "block",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
1
"__id__":
2
},
},
"_children": [
"_children": [
{
{
"__id__": 3
1
"__id__": 3
0
},
},
{
{
"__id__": 34
"__id__": 34
},
{
"__id__": 37
}
}
],
],
"_active": false,
"_active": false,
"_components": [],
"_prefab": {
"__id__": 40
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 2000,
"height": 1500
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
249.38,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 29
},
"_children": [],
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 37
"__id__": 31
},
{
"__id__": 32
}
}
],
],
"_prefab": {
"_prefab": {
"__id__": 3
8
"__id__": 3
3
},
},
"_opacity": 255,
"_opacity": 255,
"_color": {
"_color": {
...
@@ -1175,8 +1230,8 @@
...
@@ -1175,8 +1230,8 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width":
20
00,
"width":
1
00,
"height": 1
5
00
"height": 100
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -1212,22 +1267,88 @@
...
@@ -1212,22 +1267,88 @@
"groupIndex": 0,
"groupIndex": 0,
"_id": ""
"_id": ""
},
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 30
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "6c77564b-7a1f-4cd6-8959-e8cda1b2dd33"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 30
},
"_enabled": true,
"alignMode": 2,
"_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": 100,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "3d36363e-8b0c-4b06-9192-bfffb9ed35bf"
},
"fileId": "45NS3xPalObqm3m0EbfyVO",
"sync": false
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "nicetry",
"_name": "nicetry",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
30
"__id__":
29
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 3
2
"__id__": 3
5
}
}
],
],
"_prefab": {
"_prefab": {
"__id__": 3
3
"__id__": 3
6
},
},
"_opacity": 255,
"_opacity": 255,
"_color": {
"_color": {
...
@@ -1281,7 +1402,7 @@
...
@@ -1281,7 +1402,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 3
1
"__id__": 3
4
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1316,7 +1437,7 @@
...
@@ -1316,7 +1437,7 @@
"asset": {
"asset": {
"__uuid__": "3d36363e-8b0c-4b06-9192-bfffb9ed35bf"
"__uuid__": "3d36363e-8b0c-4b06-9192-bfffb9ed35bf"
},
},
"fileId": "f
7ICHPXTRH7oY+fBSkF1s1
",
"fileId": "f
c6d12R5xK3LUWGOdZTsn4
",
"sync": false
"sync": false
},
},
{
{
...
@@ -1324,17 +1445,17 @@
...
@@ -1324,17 +1445,17 @@
"_name": " dragon1",
"_name": " dragon1",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
30
"__id__":
29
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 3
5
"__id__": 3
8
}
}
],
],
"_prefab": {
"_prefab": {
"__id__": 3
6
"__id__": 3
9
},
},
"_opacity": 255,
"_opacity": 255,
"_color": {
"_color": {
...
@@ -1388,7 +1509,7 @@
...
@@ -1388,7 +1509,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 3
4
"__id__": 3
7
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1431,41 +1552,9 @@
...
@@ -1431,41 +1552,9 @@
"asset": {
"asset": {
"__uuid__": "3d36363e-8b0c-4b06-9192-bfffb9ed35bf"
"__uuid__": "3d36363e-8b0c-4b06-9192-bfffb9ed35bf"
},
},
"fileId": "
d2IvJVDI5FB66yTJbLxDTq
",
"fileId": "
87Ejs1a/hAH7584YM+5pm1
",
"sync": false
"sync": false
},
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 30
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "6c77564b-7a1f-4cd6-8959-e8cda1b2dd33"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
{
"__type__": "cc.PrefabInfo",
"__type__": "cc.PrefabInfo",
"root": {
"root": {
...
@@ -1474,7 +1563,7 @@
...
@@ -1474,7 +1563,7 @@
"asset": {
"asset": {
"__uuid__": "3d36363e-8b0c-4b06-9192-bfffb9ed35bf"
"__uuid__": "3d36363e-8b0c-4b06-9192-bfffb9ed35bf"
},
},
"fileId": "
65hSrDEqtOtoOX42rBxT2G
",
"fileId": "
53o64MrfpGk6jvC1SaO+5I
",
"sync": false
"sync": false
},
},
{
{
...
@@ -1482,23 +1571,23 @@
...
@@ -1482,23 +1571,23 @@
"_name": "over",
"_name": "over",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
1
"__id__":
2
},
},
"_children": [
"_children": [
{
{
"__id__": 4
0
"__id__": 4
2
},
},
{
{
"__id__": 4
3
"__id__": 4
5
},
},
{
{
"__id__": 4
6
"__id__": 4
8
}
}
],
],
"_active": false,
"_active": false,
"_components": [],
"_components": [],
"_prefab": {
"_prefab": {
"__id__":
49
"__id__":
51
},
},
"_opacity": 255,
"_opacity": 255,
"_color": {
"_color": {
...
@@ -1523,7 +1612,7 @@
...
@@ -1523,7 +1612,7 @@
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
0,
0,
0
,
249.38
,
0,
0,
0,
0,
0,
0,
...
@@ -1552,17 +1641,17 @@
...
@@ -1552,17 +1641,17 @@
"_name": "nicetry",
"_name": "nicetry",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
39
"__id__":
41
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 4
1
"__id__": 4
3
}
}
],
],
"_prefab": {
"_prefab": {
"__id__": 4
2
"__id__": 4
4
},
},
"_opacity": 255,
"_opacity": 255,
"_color": {
"_color": {
...
@@ -1616,7 +1705,7 @@
...
@@ -1616,7 +1705,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 4
0
"__id__": 4
2
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1651,7 +1740,7 @@
...
@@ -1651,7 +1740,7 @@
"asset": {
"asset": {
"__uuid__": "3d36363e-8b0c-4b06-9192-bfffb9ed35bf"
"__uuid__": "3d36363e-8b0c-4b06-9192-bfffb9ed35bf"
},
},
"fileId": "
421Rl9mUVB8p4qgvEp4WXR
",
"fileId": "
2crIkElRJCF5OXLDJGi0WZ
",
"sync": false
"sync": false
},
},
{
{
...
@@ -1659,17 +1748,17 @@
...
@@ -1659,17 +1748,17 @@
"_name": "comeon",
"_name": "comeon",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
39
"__id__":
41
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 4
4
"__id__": 4
6
}
}
],
],
"_prefab": {
"_prefab": {
"__id__": 4
5
"__id__": 4
7
},
},
"_opacity": 255,
"_opacity": 255,
"_color": {
"_color": {
...
@@ -1723,7 +1812,7 @@
...
@@ -1723,7 +1812,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 4
3
"__id__": 4
5
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1758,7 +1847,7 @@
...
@@ -1758,7 +1847,7 @@
"asset": {
"asset": {
"__uuid__": "3d36363e-8b0c-4b06-9192-bfffb9ed35bf"
"__uuid__": "3d36363e-8b0c-4b06-9192-bfffb9ed35bf"
},
},
"fileId": "f
5JPSjwZ1EqriwPXOAYi16
",
"fileId": "f
aW6mDJLdG9Z7/gm3KXTd4
",
"sync": false
"sync": false
},
},
{
{
...
@@ -1766,17 +1855,17 @@
...
@@ -1766,17 +1855,17 @@
"_name": " dragon2",
"_name": " dragon2",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
39
"__id__":
41
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 4
7
"__id__": 4
9
}
}
],
],
"_prefab": {
"_prefab": {
"__id__":
48
"__id__":
50
},
},
"_opacity": 255,
"_opacity": 255,
"_color": {
"_color": {
...
@@ -1830,7 +1919,7 @@
...
@@ -1830,7 +1919,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 4
6
"__id__": 4
8
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1873,7 +1962,7 @@
...
@@ -1873,7 +1962,7 @@
"asset": {
"asset": {
"__uuid__": "3d36363e-8b0c-4b06-9192-bfffb9ed35bf"
"__uuid__": "3d36363e-8b0c-4b06-9192-bfffb9ed35bf"
},
},
"fileId": "
35lPXGkIBL+boKEU0nZySj
",
"fileId": "
bcuj4cQRpJH7W9OE9mwsfq
",
"sync": false
"sync": false
},
},
{
{
...
@@ -1884,7 +1973,18 @@
...
@@ -1884,7 +1973,18 @@
"asset": {
"asset": {
"__uuid__": "3d36363e-8b0c-4b06-9192-bfffb9ed35bf"
"__uuid__": "3d36363e-8b0c-4b06-9192-bfffb9ed35bf"
},
},
"fileId": "31SANQWfZGhIG3UrrGcOeU",
"fileId": "03g0NanvhID7cX4zn4qGck",
"sync": false
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "3d36363e-8b0c-4b06-9192-bfffb9ed35bf"
},
"fileId": "91Q8ta16tPfYNnewRrj3HT",
"sync": false
"sync": false
},
},
{
{
...
@@ -1901,10 +2001,10 @@
...
@@ -1901,10 +2001,10 @@
"__id__": 13
"__id__": 13
},
},
"dragon1": {
"dragon1": {
"__id__": 3
5
"__id__": 3
8
},
},
"dragon2": {
"dragon2": {
"__id__": 4
7
"__id__": 4
9
},
},
"cakeN": {
"cakeN": {
"__id__": 2
"__id__": 2
...
...
assets/cake_class_1/scene/cake_class_1.fire
View file @
8a232f22
...
@@ -3034,7 +3034,7 @@
...
@@ -3034,7 +3034,7 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width": 2
0
00,
"width": 2
5
00,
"height": 35
"height": 35
},
},
"_anchorPoint": {
"_anchorPoint": {
...
@@ -3216,8 +3216,8 @@
...
@@ -3216,8 +3216,8 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width":
2
000,
"width":
4
000,
"height":
2
000
"height":
4
000
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
...
assets/cake_class_1/scene/cake_class_1.ts
View file @
8a232f22
...
@@ -70,7 +70,7 @@ export default class cake_class_1 extends MyCocosSceneComponent {
...
@@ -70,7 +70,7 @@ export default class cake_class_1 extends MyCocosSceneComponent {
}
}
initCandle1
()
{
initCandle1
()
{
this
.
candle1
.
x
=
-
85
0
this
.
candle1
.
x
=
-
cc
.
winSize
.
width
/
2
-
20
0
let
candleS
=
this
.
candle1
.
getComponent
(
"
candle
"
)
let
candleS
=
this
.
candle1
.
getComponent
(
"
candle
"
)
let
maskNode
=
this
.
candle1
.
getChildByName
(
"
mask
"
);
let
maskNode
=
this
.
candle1
.
getChildByName
(
"
mask
"
);
candleS
.
dragon1
.
node
.
active
=
true
;
candleS
.
dragon1
.
node
.
active
=
true
;
...
@@ -78,7 +78,7 @@ export default class cake_class_1 extends MyCocosSceneComponent {
...
@@ -78,7 +78,7 @@ export default class cake_class_1 extends MyCocosSceneComponent {
candleS
.
dragon3
.
node
.
active
=
false
;
candleS
.
dragon3
.
node
.
active
=
false
;
}
}
initCandle2
()
{
initCandle2
()
{
this
.
candle2
.
x
=
-
85
0
this
.
candle2
.
x
=
-
cc
.
winSize
.
width
/
2
-
20
0
let
maskNode
=
this
.
candle2
.
getChildByName
(
"
mask
"
);
let
maskNode
=
this
.
candle2
.
getChildByName
(
"
mask
"
);
maskNode
.
height
=
this
.
candle2
.
height
=
333
maskNode
.
height
=
this
.
candle2
.
height
=
333
let
candleS
=
this
.
candle2
.
getComponent
(
"
candle
"
)
let
candleS
=
this
.
candle2
.
getComponent
(
"
candle
"
)
...
@@ -89,19 +89,19 @@ export default class cake_class_1 extends MyCocosSceneComponent {
...
@@ -89,19 +89,19 @@ export default class cake_class_1 extends MyCocosSceneComponent {
this
.
initCandle2
();
this
.
initCandle2
();
this
.
playLocalAudio
(
"
in
"
)
this
.
playLocalAudio
(
"
in
"
)
cc
.
tween
(
this
.
candle2
)
cc
.
tween
(
this
.
candle2
)
.
to
(
0.3
,
{
x
:
-
5
50
})
.
to
(
0.3
,
{
x
:
-
cc
.
winSize
.
width
/
2
+
1
50
})
.
start
();
.
start
();
}
}
moveInCandle1
()
{
moveInCandle1
()
{
this
.
initCandle1
();
this
.
initCandle1
();
this
.
playLocalAudio
(
"
in
"
)
this
.
playLocalAudio
(
"
in
"
)
cc
.
tween
(
this
.
candle1
)
cc
.
tween
(
this
.
candle1
)
.
to
(
0.3
,
{
x
:
-
5
50
})
.
to
(
0.3
,
{
x
:
-
cc
.
winSize
.
width
/
2
+
1
50
})
.
start
();
.
start
();
}
}
moveOutCandle1
(
cb
=
null
)
{
moveOutCandle1
(
cb
=
null
)
{
cc
.
tween
(
this
.
candle1
)
cc
.
tween
(
this
.
candle1
)
.
to
(
0.3
,
{
x
:
-
85
0
})
.
to
(
0.3
,
{
x
:
-
cc
.
winSize
.
width
/
2
-
20
0
})
.
call
(()
=>
{
.
call
(()
=>
{
if
(
cb
)
cb
();
if
(
cb
)
cb
();
})
})
...
@@ -109,15 +109,15 @@ export default class cake_class_1 extends MyCocosSceneComponent {
...
@@ -109,15 +109,15 @@ export default class cake_class_1 extends MyCocosSceneComponent {
}
}
moveOutCandle2
()
{
moveOutCandle2
()
{
cc
.
tween
(
this
.
candle2
)
cc
.
tween
(
this
.
candle2
)
.
to
(
0.3
,
{
x
:
-
85
0
})
.
to
(
0.3
,
{
x
:
-
cc
.
winSize
.
width
/
2
-
20
0
})
.
start
();
.
start
();
}
}
initMusicBtn
()
{
initMusicBtn
()
{
this
.
musicBtn
.
node
.
x
=
85
0
;
this
.
musicBtn
.
node
.
x
=
cc
.
winSize
.
width
/
2
+
20
0
;
this
.
musicBtn
.
interactable
=
true
;
this
.
musicBtn
.
interactable
=
true
;
}
}
initRedBtn
()
{
initRedBtn
()
{
this
.
redBtnN
.
x
=
85
0
;
this
.
redBtnN
.
x
=
cc
.
winSize
.
width
/
2
+
20
0
;
}
}
startGame
()
{
startGame
()
{
this
.
answerList
[
this
.
questionIndex
]
=
0
;
this
.
answerList
[
this
.
questionIndex
]
=
0
;
...
@@ -137,7 +137,7 @@ export default class cake_class_1 extends MyCocosSceneComponent {
...
@@ -137,7 +137,7 @@ export default class cake_class_1 extends MyCocosSceneComponent {
},
this
.
data
.
questions
[
this
.
questionIndex
].
choosewaitTime
*
1000
)
},
this
.
data
.
questions
[
this
.
questionIndex
].
choosewaitTime
*
1000
)
this
.
initMusicBtn
();
this
.
initMusicBtn
();
cc
.
tween
(
this
.
musicBtn
.
node
)
cc
.
tween
(
this
.
musicBtn
.
node
)
.
to
(
0.3
,
{
x
:
5
50
})
.
to
(
0.3
,
{
x
:
cc
.
winSize
.
width
/
2
-
1
50
})
.
start
()
.
start
()
})
})
this
.
moveInCandle1
();
this
.
moveInCandle1
();
...
@@ -200,6 +200,11 @@ export default class cake_class_1 extends MyCocosSceneComponent {
...
@@ -200,6 +200,11 @@ export default class cake_class_1 extends MyCocosSceneComponent {
this
.
initListener
();
this
.
initListener
();
}
}
start
():
void
{
start
():
void
{
super
.
start
()
this
.
initCandle1
();
this
.
initCandle2
();
this
.
initRedBtn
();
this
.
initMusicBtn
();
let
bgNode
=
cc
.
find
(
"
bg/bg
"
,
this
.
node
);
let
bgNode
=
cc
.
find
(
"
bg/bg
"
,
this
.
node
);
let
scaleX
=
cc
.
winSize
.
width
/
bgNode
.
width
;
let
scaleX
=
cc
.
winSize
.
width
/
bgNode
.
width
;
let
scaleY
=
cc
.
winSize
.
height
/
bgNode
.
height
;
let
scaleY
=
cc
.
winSize
.
height
/
bgNode
.
height
;
...
@@ -208,8 +213,9 @@ export default class cake_class_1 extends MyCocosSceneComponent {
...
@@ -208,8 +213,9 @@ export default class cake_class_1 extends MyCocosSceneComponent {
}
else
{
}
else
{
bgNode
.
scale
=
scaleY
;
bgNode
.
scale
=
scaleY
;
}
}
}
initNodePos
(){
super
.
start
();
}
}
dataCallBack
()
{
dataCallBack
()
{
super
.
dataCallBack
();
super
.
dataCallBack
();
...
@@ -259,7 +265,7 @@ export default class cake_class_1 extends MyCocosSceneComponent {
...
@@ -259,7 +265,7 @@ export default class cake_class_1 extends MyCocosSceneComponent {
this
.
clearTimeouts
()
this
.
clearTimeouts
()
if
(
isSuc
)
{
if
(
isSuc
)
{
cc
.
tween
(
this
.
musicBtn
.
node
)
cc
.
tween
(
this
.
musicBtn
.
node
)
.
to
(
0.3
,
{
x
:
85
0
})
.
to
(
0.3
,
{
x
:
cc
.
winSize
.
width
/
2
+
20
0
})
.
call
(()
=>
{
.
call
(()
=>
{
})
})
...
...
assets/cake_class_1/script/panel.ts
View file @
8a232f22
...
@@ -51,7 +51,7 @@ export default class panel extends cc.Component {
...
@@ -51,7 +51,7 @@ export default class panel extends cc.Component {
// }, "waitTime": 12, "choosewaitTime": 5, "testWaitTime": 3, "rightLetter": "d", "wrongLetter": "b"
// }, "waitTime": 12, "choosewaitTime": 5, "testWaitTime": 3, "rightLetter": "d", "wrongLetter": "b"
// }, }
// }, }
initPanel
(
data
,
mainCtil
)
{
initPanel
(
data
,
mainCtil
)
{
this
.
frameN
.
y
=
10
00
;
this
.
frameN
.
y
=
cc
.
winSize
.
height
+
4
00
;
this
.
frameN
.
off
(
"
click
"
);
this
.
frameN
.
off
(
"
click
"
);
this
.
frameN
.
on
(
"
click
"
,
()
=>
{
this
.
frameN
.
on
(
"
click
"
,
()
=>
{
this
.
playDragon
();
this
.
playDragon
();
...
@@ -87,8 +87,8 @@ export default class panel extends cc.Component {
...
@@ -87,8 +87,8 @@ export default class panel extends cc.Component {
rightPice
.
zIndex
=
10
-
index
;
rightPice
.
zIndex
=
10
-
index
;
rightPice
.
parent
=
picesN
;
rightPice
.
parent
=
picesN
;
wrongPice
.
parent
=
picesN
;
wrongPice
.
parent
=
picesN
;
rightPice
.
x
=
45
0
rightPice
.
x
=
cc
.
winSize
.
width
/
2
-
20
0
wrongPice
.
x
=
45
0
wrongPice
.
x
=
cc
.
winSize
.
width
/
2
-
20
0
wrongPice
.
name
=
"
wrongPice
"
wrongPice
.
name
=
"
wrongPice
"
rightPice
.
name
=
"
rightPice
"
rightPice
.
name
=
"
rightPice
"
rightPice
.
getComponentInChildren
(
cc
.
Label
).
string
=
data
.
rightLetter
;
rightPice
.
getComponentInChildren
(
cc
.
Label
).
string
=
data
.
rightLetter
;
...
@@ -172,13 +172,13 @@ export default class panel extends cc.Component {
...
@@ -172,13 +172,13 @@ export default class panel extends cc.Component {
}
}
)
)
cc
.
tween
(
this
.
mainCtil
.
musicBtn
.
node
)
cc
.
tween
(
this
.
mainCtil
.
musicBtn
.
node
)
.
to
(
0.3
,
{
x
:
9
00
})
.
to
(
0.3
,
{
x
:
cc
.
winSize
.
width
/
2
+
2
00
})
.
start
();
.
start
();
}
else
{
}
else
{
rightPice
.
active
=
false
;
rightPice
.
active
=
false
;
this
.
mainCtil
.
moveOutCandle1
()
this
.
mainCtil
.
moveOutCandle1
()
cc
.
tween
(
this
.
mainCtil
.
musicBtn
.
node
)
cc
.
tween
(
this
.
mainCtil
.
musicBtn
.
node
)
.
to
(
0.3
,
{
x
:
900
})
.
to
(
0.3
,
{
x
:
cc
.
winSize
.
width
/
2
+
200
})
.
start
();
.
start
();
this
.
mainCtil
.
playLocalAudio
(
"
err
"
);
this
.
mainCtil
.
playLocalAudio
(
"
err
"
);
cc
.
tween
(
wrongPice
)
cc
.
tween
(
wrongPice
)
...
@@ -198,7 +198,7 @@ export default class panel extends cc.Component {
...
@@ -198,7 +198,7 @@ export default class panel extends cc.Component {
outPice
()
{
outPice
()
{
let
wrongPice
=
cc
.
find
(
"
cake/picesP
"
,
this
.
node
).
getChildByName
(
"
wrongPice
"
)
let
wrongPice
=
cc
.
find
(
"
cake/picesP
"
,
this
.
node
).
getChildByName
(
"
wrongPice
"
)
cc
.
tween
(
wrongPice
)
cc
.
tween
(
wrongPice
)
.
to
(
0.3
,
{
x
:
11
00
})
.
to
(
0.3
,
{
x
:
cc
.
winSize
.
width
/
2
+
4
00
})
.
call
(()
=>
{
.
call
(()
=>
{
wrongPice
.
destroy
();
wrongPice
.
destroy
();
cc
.
tween
(
this
.
frameN
)
cc
.
tween
(
this
.
frameN
)
...
@@ -211,7 +211,7 @@ export default class panel extends cc.Component {
...
@@ -211,7 +211,7 @@ export default class panel extends cc.Component {
this
.
mainCtil
.
moveInCandle2
();
this
.
mainCtil
.
moveInCandle2
();
this
.
mainCtil
.
initRedBtn
();
this
.
mainCtil
.
initRedBtn
();
cc
.
tween
(
this
.
mainCtil
.
redBtnN
)
cc
.
tween
(
this
.
mainCtil
.
redBtnN
)
.
to
(
0.3
,
{
x
:
5
50
})
.
to
(
0.3
,
{
x
:
cc
.
winSize
.
width
/
2
-
1
50
})
.
start
();
.
start
();
// guideAudio
// guideAudio
})
})
...
@@ -232,8 +232,9 @@ export default class panel extends cc.Component {
...
@@ -232,8 +232,9 @@ export default class panel extends cc.Component {
}
}
}
}
showBlock
(){
showBlock
(){
let
block
=
this
.
node
.
getChildByName
(
"
block
"
);
let
block
=
cc
.
find
(
"
cake/block
"
,
this
.
node
);
block
.
active
=
true
;
block
.
active
=
true
;
block
.
getChildByName
(
"
bg
"
).
getComponent
(
cc
.
Widget
).
target
=
cc
.
find
(
"
Canvas
"
);
block
.
opacity
=
0
;
block
.
opacity
=
0
;
cc
.
tween
(
block
)
cc
.
tween
(
block
)
.
to
(
0.5
,
{
opacity
:
255
})
.
to
(
0.5
,
{
opacity
:
255
})
...
@@ -245,10 +246,14 @@ export default class panel extends cc.Component {
...
@@ -245,10 +246,14 @@ export default class panel extends cc.Component {
}
}
showResult
(
isSuc
)
{
showResult
(
isSuc
)
{
// this.dragon.node.active=false;
// this.dragon.node.active=false;
let
block
=
this
.
node
.
getChildByName
(
"
block
"
);
let
block
=
cc
.
find
(
"
cake/block
"
,
this
.
node
);
block
.
getChildByName
(
"
bg
"
).
getComponent
(
cc
.
Widget
).
target
=
cc
.
find
(
"
Canvas
"
);
let
nicetry
=
block
.
getChildByName
(
"
nicetry
"
);
let
nicetry
=
block
.
getChildByName
(
"
nicetry
"
);
this
.
dragon1
.
node
.
active
=
true
;
this
.
dragon1
.
node
.
active
=
false
;
nicetry
.
active
=
false
;
if
(
isSuc
)
{
if
(
isSuc
)
{
this
.
dragon1
.
node
.
active
=
true
;
this
.
mainCtil
.
playLocalAudio
(
"
excellent
"
)
this
.
mainCtil
.
playLocalAudio
(
"
excellent
"
)
this
.
dragon1
.
playAnimation
(
"
newAnimation
"
,
1
)
this
.
dragon1
.
playAnimation
(
"
newAnimation
"
,
1
)
this
.
dragon1
.
on
(
dragonBones
.
EventObject
.
COMPLETE
,
()
=>
{
this
.
dragon1
.
on
(
dragonBones
.
EventObject
.
COMPLETE
,
()
=>
{
...
@@ -259,6 +264,7 @@ export default class panel extends cc.Component {
...
@@ -259,6 +264,7 @@ export default class panel extends cc.Component {
})
})
}
else
{
}
else
{
nicetry
.
active
=
true
;
this
.
mainCtil
.
playLocalAudio
(
"
talkerr
"
)
this
.
mainCtil
.
playLocalAudio
(
"
talkerr
"
)
this
.
dragon1
.
node
.
active
=
false
;
this
.
dragon1
.
node
.
active
=
false
;
cc
.
tween
(
nicetry
)
cc
.
tween
(
nicetry
)
...
@@ -281,10 +287,12 @@ export default class panel extends cc.Component {
...
@@ -281,10 +287,12 @@ export default class panel extends cc.Component {
this
.
dragon
.
node
.
active
=
false
;
this
.
dragon
.
node
.
active
=
false
;
let
length
=
answerList
.
length
;
let
length
=
answerList
.
length
;
let
sucTime
=
0
;
let
sucTime
=
0
;
let
over
=
cc
.
find
(
"
over
"
,
this
.
node
);
let
over
=
cc
.
find
(
"
cake/
over
"
,
this
.
node
);
over
.
active
=
true
;
over
.
active
=
true
;
let
nicetry
=
cc
.
find
(
"
over/nicetry
"
,
this
.
node
);
let
nicetry
=
cc
.
find
(
"
cake/over/nicetry
"
,
this
.
node
);
let
comeon
=
cc
.
find
(
"
over/comeon
"
,
this
.
node
)
let
comeon
=
cc
.
find
(
"
cake/over/comeon
"
,
this
.
node
)
nicetry
.
active
=
false
;
comeon
.
active
=
false
;
for
(
let
i
=
0
;
i
<
length
;
i
++
){
for
(
let
i
=
0
;
i
<
length
;
i
++
){
if
(
answerList
[
i
]
==
1
){
if
(
answerList
[
i
]
==
1
){
sucTime
++
sucTime
++
...
@@ -298,6 +306,7 @@ export default class panel extends cc.Component {
...
@@ -298,6 +306,7 @@ export default class panel extends cc.Component {
this
.
dragon2
.
playAnimation
(
"
normal
"
,
1
)
this
.
dragon2
.
playAnimation
(
"
normal
"
,
1
)
this
.
mainCtil
.
playLocalAudio
(
"
allRigtht
"
)
this
.
mainCtil
.
playLocalAudio
(
"
allRigtht
"
)
}
else
if
((
sucTime
/
length
)
>=
0.6
){
}
else
if
((
sucTime
/
length
)
>=
0.6
){
nicetry
.
active
=
true
;
this
.
mainCtil
.
playLocalAudio
(
"
nicetry
"
);
this
.
mainCtil
.
playLocalAudio
(
"
nicetry
"
);
cc
.
tween
(
nicetry
)
cc
.
tween
(
nicetry
)
.
to
(
0.3
,
{
y
:
-
50
})
.
to
(
0.3
,
{
y
:
-
50
})
...
@@ -306,6 +315,7 @@ export default class panel extends cc.Component {
...
@@ -306,6 +315,7 @@ export default class panel extends cc.Component {
.
to
(
0.3
,
{
y
:
-
700
})
.
to
(
0.3
,
{
y
:
-
700
})
.
start
();
.
start
();
}
else
{
}
else
{
comeon
.
active
=
true
;
this
.
mainCtil
.
playLocalAudio
(
"
comeon
"
)
this
.
mainCtil
.
playLocalAudio
(
"
comeon
"
)
cc
.
tween
(
comeon
)
cc
.
tween
(
comeon
)
.
to
(
0.3
,
{
y
:
-
50
})
.
to
(
0.3
,
{
y
:
-
50
})
...
...
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