Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
ngt14_czm
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
ngt14_czm
Commits
7100d3e4
Commit
7100d3e4
authored
Oct 27, 2022
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
正确错误效果完成
parent
e975e26a
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
338 additions
and
62 deletions
+338
-62
star.meta
assets/cocos_generator/dragonBones/star.meta
+12
-0
星星_ske.json
assets/cocos_generator/dragonBones/star/星星_ske.json
+2
-0
星星_ske.json.meta
assets/cocos_generator/dragonBones/star/星星_ske.json.meta
+6
-0
星星_tex.json
assets/cocos_generator/dragonBones/star/星星_tex.json
+2
-0
星星_tex.json.meta
assets/cocos_generator/dragonBones/star/星星_tex.json.meta
+6
-0
星星_tex.png
assets/cocos_generator/dragonBones/star/星星_tex.png
+0
-0
星星_tex.png.meta
assets/cocos_generator/dragonBones/star/星星_tex.png.meta
+37
-0
cocos_generator.fire
assets/cocos_generator/scene/cocos_generator.fire
+138
-33
cocos_generator.ts
assets/cocos_generator/scene/cocos_generator.ts
+128
-26
ngt10_layout_mouse.ts
assets/cocos_generator/scene/small/ngt10_layout_mouse.ts
+3
-3
Game.ts
assets/cocos_generator/scene/tool/Game.ts
+4
-0
No files found.
assets/cocos_generator/dragonBones/star.meta
0 → 100644
View file @
7100d3e4
{
"ver": "1.1.2",
"uuid": "4b356d73-d687-4401-86c5-0d10cccc8efd",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
assets/cocos_generator/dragonBones/star/星星_ske.json
0 → 100644
View file @
7100d3e4
{
"frameRate"
:
24
,
"name"
:
"星星"
,
"version"
:
"5.5"
,
"compatibleVersion"
:
"5.5"
,
"armature"
:[{
"type"
:
"Armature"
,
"frameRate"
:
24
,
"name"
:
"armatureName"
,
"aabb"
:{
"x"
:
-49.5
,
"y"
:
-54
,
"width"
:
99
,
"height"
:
109
},
"bone"
:[{
"name"
:
"root"
},{
"length"
:
50
,
"name"
:
"星星"
,
"parent"
:
"root"
}],
"slot"
:[{
"name"
:
"1"
,
"parent"
:
"星星"
},{
"name"
:
"2"
,
"parent"
:
"星星"
},{
"name"
:
"3"
,
"parent"
:
"星星"
},{
"name"
:
"4"
,
"parent"
:
"星星"
},{
"name"
:
"5"
,
"parent"
:
"星星"
}],
"skin"
:[{
"slot"
:[{
"name"
:
"3"
,
"display"
:[{
"name"
:
"3"
,
"transform"
:{
"y"
:
0.5
}}]},{
"name"
:
"5"
,
"display"
:[{
"name"
:
"5"
,
"transform"
:{
"y"
:
0.5
}}]},{
"name"
:
"4"
,
"display"
:[{
"name"
:
"4"
,
"transform"
:{
"y"
:
0.5
}}]},{
"name"
:
"2"
,
"display"
:[{
"name"
:
"2"
,
"transform"
:{
"x"
:
0.5
}}]},{
"name"
:
"1"
,
"display"
:[{
"name"
:
"1"
,
"transform"
:{
"x"
:
0.5
}}]}]}],
"animation"
:[{
"duration"
:
21
,
"playTimes"
:
0
,
"name"
:
"newAnimation"
,
"slot"
:[{
"name"
:
"1"
,
"colorFrame"
:[{
"duration"
:
2
},{
"tweenEasing"
:
0
},{
"duration"
:
2
,
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
70
}},{
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
70
}},{
"duration"
:
2
,
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
35
}},{
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
35
}},{
"duration"
:
12
,
"value"
:{
"aM"
:
0
}}]},{
"name"
:
"2"
,
"colorFrame"
:[{
"duration"
:
2
,
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
0
}},{
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
0
}},{
"duration"
:
2
,
"tweenEasing"
:
0
},{
"tweenEasing"
:
0
},{
"duration"
:
2
,
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
70
}},{
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
70
}},{
"duration"
:
2
,
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
35
}},{
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
35
}},{
"duration"
:
9
,
"value"
:{
"aM"
:
0
}}]},{
"name"
:
"3"
,
"colorFrame"
:[{
"duration"
:
5
,
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
0
}},{
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
0
}},{
"duration"
:
2
,
"tweenEasing"
:
0
},{
"tweenEasing"
:
0
},{
"duration"
:
2
,
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
70
}},{
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
70
}},{
"duration"
:
2
,
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
35
}},{
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
35
}},{
"duration"
:
6
,
"value"
:{
"aM"
:
0
}}]},{
"name"
:
"4"
,
"colorFrame"
:[{
"duration"
:
8
,
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
0
}},{
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
0
}},{
"duration"
:
2
,
"tweenEasing"
:
0
},{
"tweenEasing"
:
0
},{
"duration"
:
2
,
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
70
}},{
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
70
}},{
"duration"
:
2
,
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
35
}},{
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
35
}},{
"duration"
:
3
,
"value"
:{
"aM"
:
0
}}]},{
"name"
:
"5"
,
"colorFrame"
:[{
"duration"
:
11
,
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
0
}},{
"tweenEasing"
:
0
,
"value"
:{
"aM"
:
0
}},{
"duration"
:
8
,
"tweenEasing"
:
0
},{
"tweenEasing"
:
0
},{
"duration"
:
0
,
"value"
:{
"aM"
:
0
}}]}]}],
"defaultActions"
:[{
"gotoAndPlay"
:
"newAnimation"
}]}]}
\ No newline at end of file
assets/cocos_generator/dragonBones/star/星星_ske.json.meta
0 → 100644
View file @
7100d3e4
{
"ver": "1.0.1",
"uuid": "f5c1977d-d6fc-4ab6-9496-39ea8c31d8d7",
"subMetas": {}
}
\ No newline at end of file
assets/cocos_generator/dragonBones/star/星星_tex.json
0 → 100644
View file @
7100d3e4
{
"SubTexture"
:[{
"width"
:
60
,
"y"
:
1
,
"height"
:
66
,
"name"
:
"1"
,
"x"
:
102
},{
"width"
:
68
,
"y"
:
112
,
"height"
:
76
,
"name"
:
"2"
,
"x"
:
173
},{
"width"
:
79
,
"y"
:
112
,
"height"
:
89
,
"name"
:
"3"
,
"x"
:
92
},{
"width"
:
89
,
"y"
:
112
,
"height"
:
99
,
"name"
:
"4"
,
"x"
:
1
},{
"width"
:
99
,
"y"
:
1
,
"height"
:
109
,
"name"
:
"5"
,
"x"
:
1
}],
"width"
:
256
,
"height"
:
256
,
"name"
:
"星星"
,
"imagePath"
:
"星星_tex.png"
}
\ No newline at end of file
assets/cocos_generator/dragonBones/star/星星_tex.json.meta
0 → 100644
View file @
7100d3e4
{
"ver": "1.0.1",
"uuid": "102525f7-7025-4b84-ba45-e8aef9eee61d",
"subMetas": {}
}
\ No newline at end of file
assets/cocos_generator/dragonBones/star/星星_tex.png
0 → 100644
View file @
7100d3e4
9.92 KB
assets/cocos_generator/dragonBones/star/星星_tex.png.meta
0 → 100644
View file @
7100d3e4
{
"ver": "2.3.5",
"uuid": "a7ae7f17-3bb0-48f8-a921-54e1543c6b91",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 256,
"height": 256,
"platformSettings": {},
"subMetas": {
"星星_tex": {
"ver": "1.0.4",
"uuid": "8cfdf452-fcfb-4d56-bc51-9376b1428c4d",
"rawTextureUuid": "a7ae7f17-3bb0-48f8-a921-54e1543c6b91",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -7,
"offsetY": 22,
"trimX": 1,
"trimY": 1,
"width": 240,
"height": 210,
"rawWidth": 256,
"rawHeight": 256,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/cocos_generator/scene/cocos_generator.fire
View file @
7100d3e4
...
...
@@ -87,25 +87,25 @@
"__id__": 60
},
{
"__id__": 8
5
"__id__": 8
7
},
{
"__id__": 8
7
"__id__": 8
9
},
{
"__id__": 10
1
"__id__": 10
3
}
],
"_active": true,
"_components": [
{
"__id__": 10
2
"__id__": 10
4
},
{
"__id__": 10
3
"__id__": 10
5
},
{
"__id__": 10
4
"__id__": 10
6
}
],
"_prefab": null,
...
...
@@ -2923,6 +2923,9 @@
},
{
"__id__": 83
},
{
"__id__": 85
}
],
"_active": true,
...
...
@@ -3077,7 +3080,7 @@
"__id__": 60
},
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
{
"__id__": 64
...
...
@@ -4106,6 +4109,108 @@
"_N$cacheMode": 0,
"_id": "b3rNELFNJADJp9Dj0OnDR+"
},
{
"__type__": "cc.Node",
"_name": "star",
"_objFlags": 0,
"_parent": {
"__id__": 60
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 86
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 99,
"height": 109
},
"_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": "eakONcFQhDfr4rjda0cIff"
},
{
"__type__": "dragonBones.ArmatureDisplay",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 85
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_armatureName": "armatureName",
"_animationName": "newAnimation",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": 1,
"premultipliedAlpha": true,
"_armatureKey": "f5c1977d-d6fc-4ab6-9496-39ea8c31d8d7#102525f7-7025-4b84-ba45-e8aef9eee61d",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "f5c1977d-d6fc-4ab6-9496-39ea8c31d8d7"
},
"_N$dragonAtlasAsset": {
"__uuid__": "102525f7-7025-4b84-ba45-e8aef9eee61d"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 1,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "8ckTgPX2FOQ4ae1OI7w65U"
},
{
"__type__": "cc.Node",
"_name": "layout_blocks",
...
...
@@ -4117,7 +4222,7 @@
"_active": true,
"_components": [
{
"__id__": 8
6
"__id__": 8
8
}
],
"_prefab": null,
...
...
@@ -4173,7 +4278,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
5
"__id__": 8
7
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -4203,9 +4308,6 @@
"__id__": 2
},
"_children": [
{
"__id__": 88
},
{
"__id__": 90
},
...
...
@@ -4220,12 +4322,15 @@
},
{
"__id__": 98
},
{
"__id__": 100
}
],
"_active": true,
"_components": [
{
"__id__": 10
0
"__id__": 10
2
}
],
"_prefab": null,
...
...
@@ -4281,13 +4386,13 @@
"_name": "img_keyboard_1",
"_objFlags": 0,
"_parent": {
"__id__": 8
7
"__id__": 8
9
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
89
"__id__":
91
}
],
"_prefab": null,
...
...
@@ -4343,7 +4448,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
88
"__id__":
90
},
"_enabled": true,
"_materials": [
...
...
@@ -4375,13 +4480,13 @@
"_name": "img_keyboard_2",
"_objFlags": 0,
"_parent": {
"__id__": 8
7
"__id__": 8
9
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 9
1
"__id__": 9
3
}
],
"_prefab": null,
...
...
@@ -4437,7 +4542,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
0
"__id__": 9
2
},
"_enabled": true,
"_materials": [
...
...
@@ -4469,13 +4574,13 @@
"_name": "img_keyboard_3",
"_objFlags": 0,
"_parent": {
"__id__": 8
7
"__id__": 8
9
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 9
3
"__id__": 9
5
}
],
"_prefab": null,
...
...
@@ -4531,7 +4636,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
2
"__id__": 9
4
},
"_enabled": true,
"_materials": [
...
...
@@ -4563,13 +4668,13 @@
"_name": "img_keyboard_4",
"_objFlags": 0,
"_parent": {
"__id__": 8
7
"__id__": 8
9
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 9
5
"__id__": 9
7
}
],
"_prefab": null,
...
...
@@ -4625,7 +4730,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
4
"__id__": 9
6
},
"_enabled": true,
"_materials": [
...
...
@@ -4657,13 +4762,13 @@
"_name": "img_keyboard_5",
"_objFlags": 0,
"_parent": {
"__id__": 8
7
"__id__": 8
9
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 9
7
"__id__": 9
9
}
],
"_prefab": null,
...
...
@@ -4719,7 +4824,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
6
"__id__": 9
8
},
"_enabled": true,
"_materials": [
...
...
@@ -4751,13 +4856,13 @@
"_name": "label",
"_objFlags": 0,
"_parent": {
"__id__": 8
7
"__id__": 8
9
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
99
"__id__":
101
}
],
"_prefab": null,
...
...
@@ -4813,7 +4918,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
98
"__id__":
100
},
"_enabled": true,
"_materials": [
...
...
@@ -4848,7 +4953,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
7
"__id__": 8
9
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -4909,7 +5014,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 8
7
"__id__": 8
9
},
"_id": "a5CSFc15pHJrUqBqHzlHYf"
},
...
...
assets/cocos_generator/scene/cocos_generator.ts
View file @
7100d3e4
...
...
@@ -50,11 +50,23 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
gameStart
()
{
this
.
answerStr
=
""
;
this
.
answerNodes
=
[];
this
.
updateQuestion
();
this
.
updateHightLight
();
this
.
updateWords
();
}
nextQuestion
()
{
// 所有全局变量 默认都是null
this
.
_cantouch
=
true
;
let
data
=
GameNGT14
.
getIns
().
nextQuestion
();
if
(
!
data
)
{
//游戏结束
}
else
{
this
.
gameStart
();
}
}
//----------------------------------------右上题目部分-----------------------------------
private
layout_question
:
cc
.
Node
;
updateQuestion
()
{
...
...
@@ -97,6 +109,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
let
base
=
pg
.
view
.
find
(
item
,
'
base
'
);
// 确定基础layout
let
layout
=
pg
.
view
.
find
(
item
,
'
layout
'
);
layout
.
removeAllChildren
();
let
list
:
Array
<
Option
>
=
data
.
getList
();
list
.
forEach
(
option
=>
{
let
blocks
=
option
.
getList
();
...
...
@@ -172,6 +185,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
}
getHightLightNodes
()
{
let
list
=
GameNGT14
.
getIns
().
getHightList
();
return
this
.
layout_blocks
.
children
.
filter
(
node
=>
{
return
list
.
some
(
li
=>
li
.
compare
(
node
.
data
))
})
}
// 更新面板高亮
updateHightLight
()
{
let
list
=
GameNGT14
.
getIns
().
getHightList
();
...
...
@@ -187,14 +206,34 @@ export default class SceneComponent extends MyCocosSceneComponent {
first
=
true
;
pg
.
view
.
visible
(
pg
.
view
.
find
(
node
,
'
img_focus2
'
),
true
)
}
}
else
{
pg
.
view
.
visible
(
pg
.
view
.
find
(
node
,
'
img_undone
'
),
true
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
node
,
'
img_focus
'
),
false
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
node
,
'
img_focus2
'
),
false
)
}
// else {
// pg.view.visible(pg.view.find(node, 'img_undone'), true)
// pg.view.visible(pg.view.find(node, 'img_focus'), false)
// pg.view.visible(pg.view.find(node, 'img_focus2'), false)
// }
})
}
// 更新面板颜色
updateBlockColor
(
nodes
,
nodeName
)
{
nodes
.
forEach
(
node
=>
{
pg
.
view
.
visible
(
pg
.
view
.
find
(
node
,
'
img_undone
'
),
false
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
node
,
'
img_focus
'
),
false
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
node
,
'
img_keyboard_1
'
),
false
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
node
,
'
img_keyboard_2
'
),
false
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
node
,
'
img_keyboard_3
'
),
false
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
node
,
'
img_keyboard_4
'
),
false
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
node
,
'
img_keyboard_5
'
),
false
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
node
,
'
img_right
'
),
false
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
node
,
'
img_right_wrong
'
),
false
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
node
,
'
img_wrong
'
),
false
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
node
,
nodeName
),
true
)
})
}
// 更新当前面板颜色
private
answerStr
:
string
;
private
answerNodes
:
Array
<
cc
.
Node
>
;
updateCurrentNodeColor
(
node
,
data
)
{
let
label
=
node
.
getChildByName
(
'
label
'
)
pg
.
view
.
visible
(
label
,
true
)
...
...
@@ -204,6 +243,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
let
block
=
node
.
data
;
block
.
val
=
data
.
word
;
this
.
answerStr
+=
data
.
word
;
this
.
answerNodes
.
push
(
node
);
}
getBlockNodeByPos
(
x
,
y
)
{
...
...
@@ -231,8 +272,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
node
.
x
=
280
+
space
.
x
*
(
index
-
9
)
node
.
y
=
-
110
-
space
.
y
*
2
;
}
data
.
pos
=
cc
.
v2
(
node
)
this
.
layout_words
.
addChild
(
node
);
data
.
pos
=
cc
.
v2
(
node
)
//入场动画
node
.
x
=
node
.
x
+
1000
;
cc
.
tween
(
node
).
delay
(
0.1
*
index
).
by
(
0.5
,
{
x
:
-
1000
}).
start
();
this
.
updateWord
(
node
,
data
);
});
}
...
...
@@ -274,8 +318,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
onItemTouchEnd
(
e
)
{
let
target
:
cc
.
Node
=
e
.
target
;
let
data
=
target
.
data
;
if
(
!
this
.
touching
)
return
;
if
(
this
.
touching
!=
data
)
return
;
if
(
!
this
.
touching
||
this
.
touching
!=
data
)
{
this
.
touching
=
null
;
target
.
x
=
target
.
data
.
pos
.
x
;
target
.
y
=
target
.
data
.
pos
.
y
;
return
;
}
// let rect = cc.rect(target.x, target.y, target.width, target.height);
let
rect
=
cc
.
rect
(
target
.
x
,
target
.
y
,
1
,
1
);
//坐标转换
...
...
@@ -292,12 +342,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
})
//是否碰撞
if
(
!
collNode
)
{
if
(
!
collNode
||
!
collNode
.
data
.
rightVal
||
!!
collNode
.
data
.
val
)
{
this
.
touching
=
null
;
target
.
x
=
target
.
data
.
pos
.
x
;
target
.
y
=
target
.
data
.
pos
.
y
;
return
;
}
//是否正确
this
.
playLocalAudio
(
'
move
'
).
then
(()
=>
{
})
let
item
=
target
;
...
...
@@ -312,30 +364,80 @@ export default class SceneComponent extends MyCocosSceneComponent {
item
.
off
(
cc
.
Node
.
EventType
.
TOUCH_CANCEL
,
this
.
onItemTouchCancel
,
this
);
// 判断此行是否完成
let
lineFull
=
true
;
let
lineFull
=
this
.
answerStr
.
length
==
GameNGT14
.
getIns
().
getCurrent
().
answer
.
length
;
let
isRight
=
this
.
answerStr
==
GameNGT14
.
getIns
().
getCurrent
().
answer
if
(
lineFull
)
{
let
nodes
=
this
.
getHightLightNodes
();
if
(
isRight
)
{
//执行放大10%
nodes
.
forEach
((
node
,
index
)
=>
{
//执行星星动画
this
.
scheduleOnce
(()
=>
{
pg
.
view
.
visible
(
pg
.
view
.
find
(
node
,
'
star
'
),
true
)
cc
.
tween
(
node
).
by
(
0.2
,
{
scale
:
0.1
}).
by
(
0.2
,
{
scale
:
-
0.1
}).
start
();
if
(
index
==
nodes
.
length
-
1
)
{
this
.
scheduleOnce
(()
=>
{
//执行颜色变right
this
.
updateBlockColor
(
nodes
,
'
img_right
'
)
//播放right音效
this
.
playLocalAudio
(
'
right
'
).
then
(()
=>
{
pg
.
event
.
emit
(
'
mouse_05_add
'
)
//其他字母向下掉出
this
.
layout_words
.
children
.
forEach
((
node
,
index
)
=>
{
cc
.
tween
(
node
)
.
delay
(
0.05
*
index
)
.
by
(
0.3
,
{
y
:
-
1000
})
.
delay
(
0.3
)
.
call
(()
=>
{
this
.
nextQuestion
();
})
.
start
();
})
})
},
0.3
)
}
},
0.1
*
index
)
})
}
else
{
//执行颜色变error
this
.
updateBlockColor
(
nodes
,
'
img_wrong
'
)
//播放error音频
this
.
playLocalAudio
(
'
error
'
).
then
(()
=>
{
//执行放大10%
nodes
.
forEach
(
node
=>
{
cc
.
tween
(
node
)
.
by
(
0.2
,
{
scale
:
0.1
})
.
by
(
0.2
,
{
scale
:
-
0.1
})
.
call
(()
=>
{
})
.
start
();
})
this
.
scheduleOnce
(()
=>
{
//执行颜色变right_wrong
this
.
updateBlockColor
(
nodes
,
'
img_right_wrong
'
)
//播放音频right_wrong
this
.
playLocalAudio
(
'
right_wrong
'
)
//播放灰色徽章
pg
.
event
.
emit
(
"
mouse_10_add_error
"
);
//其他字母向下掉出
this
.
layout_words
.
children
.
forEach
((
node
,
index
)
=>
{
cc
.
tween
(
node
)
.
delay
(
0.05
*
index
)
.
by
(
0.3
,
{
y
:
-
1000
})
.
delay
(
0.1
)
.
call
(()
=>
{
this
.
nextQuestion
();
})
.
start
();
})
},
1
)
})
}
}
else
{
// 下一个格子刷新聚焦
this
.
updateHightLight
();
}
}).
start
();
// this.playLocalAudio('right').then(() => {
// if (data.audioUrl) {
// pg.audio.playAudioByUrlThen(data.audioUrl).then(() => {
// this.touching = null;
// })
// } else {
// this.touching = null;
// }
// })
// this.touching = null;
// target.x = target.data.pos.x;
// target.y = target.data.pos.y;
// 检测一行是否完成, 完成加星星
// pg.event.emit('mouse_05_add')
return
;
...
...
assets/cocos_generator/scene/small/ngt10_layout_mouse.ts
View file @
7100d3e4
...
...
@@ -15,12 +15,12 @@ const { ccclass, property } = cc._decorator;
export
default
class
Ngt_star_10
extends
cc
.
Component
{
// LIFE-CYCLE CALLBACKS:
onLoad
()
{
pg
.
event
.
on
(
"
mouse_10_add
"
,
(
isRight
=
true
)
=>
{
this
.
showBigStar
(
isRight
);
});
pg
.
event
.
on
(
"
mouse_10_num
"
,
(
max
:
number
)
=>
{
this
.
initStar
(
max
);
});
pg
.
event
.
on
(
"
mouse_10_add
"
,
(
isRight
=
true
)
=>
{
this
.
showBigStar
(
isRight
);
});
pg
.
event
.
on
(
"
mouse_10_add_error
"
,
(
isRight
=
true
)
=>
{
this
.
showErrorStar
();
});
...
...
assets/cocos_generator/scene/tool/Game.ts
View file @
7100d3e4
...
...
@@ -178,6 +178,10 @@ export class GameNGT14 {
getCurrent
():
Question
{
return
this
.
questions
[
this
.
current
];
}
nextQuestion
()
{
this
.
current
++
;
return
this
.
getCurrent
();
}
static
ins
:
GameNGT14
;
static
getIns
():
GameNGT14
{
if
(
!
GameNGT14
.
ins
)
GameNGT14
.
ins
=
new
GameNGT14
();
...
...
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