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
17130b4c
Commit
17130b4c
authored
Nov 18, 2022
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修复
parent
76eef046
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
ngt14_czm.ts
assets/ngt14_czm/scene/ngt14_czm.ts
+17
-12
No files found.
assets/ngt14_czm/scene/ngt14_czm.ts
View file @
17130b4c
...
...
@@ -315,12 +315,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
// 更新当前面板颜色
private
answerArr
:
Array
<
cc
.
Node
>
;
private
answerArr
:
Array
<
{
nd
,
bg
}
>
;
private
isRight
()
{
let
answer
=
GameNGT14
.
getIns
().
getCurrent
().
answer
;
let
str
=
""
;
this
.
answerArr
.
sort
((
A
,
B
)
=>
A
.
x
-
B
.
x
);
this
.
answerArr
.
forEach
(
node
=>
str
+=
node
.
data
.
word
)
this
.
answerArr
.
sort
((
A
,
B
)
=>
A
.
nd
.
x
-
B
.
nd
.
x
);
this
.
answerArr
.
forEach
(
node
=>
str
+=
node
.
nd
.
data
.
word
)
return
answer
==
str
;
}
private
answerNodes
:
Array
<
cc
.
Node
>
;
...
...
@@ -415,6 +415,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
target
.
x
=
target
.
data
.
pos
.
x
;
target
.
y
=
target
.
data
.
pos
.
y
;
target
.
scale
=
1
;
this
.
answerArr
=
this
.
answerArr
.
filter
(
ans
=>
{
return
ans
.
nd
!=
target
;
})
return
;
}
// let rect = cc.rect(target.x, target.y, target.width, target.height);
...
...
@@ -437,32 +440,34 @@ export default class SceneComponent extends MyCocosSceneComponent {
target
.
x
=
target
.
data
.
pos
.
x
;
target
.
y
=
target
.
data
.
pos
.
y
;
target
.
scale
=
1
;
this
.
answerArr
=
this
.
answerArr
.
filter
(
ans
=>
{
return
ans
.
nd
!=
target
;
})
return
;
}
//是否正确
this
.
playLocalAudio
(
'
move
'
).
then
(()
=>
{
})
let
item
=
target
;
let
pos
=
target
.
parent
.
convertToNodeSpaceAR
(
collNode
.
convertToWorldSpaceAR
(
cc
.
v2
(
0
,
0
)));
let
scale
=
collNode
.
width
/
target
.
width
;
cc
.
tween
(
target
).
to
(
0.15
,
{
scale
:
scale
,
rotation
:
0
,
x
:
pos
.
x
,
y
:
pos
.
y
}).
call
(()
=>
{
// block需要显示内容
this
.
updateCurrentNodeColor
(
collNode
,
data
);
// target.active = false;
this
.
touching
=
null
;
this
.
answerArr
.
push
(
target
);
this
.
answerArr
.
push
(
{
bg
:
collNode
,
nd
:
target
}
);
target
.
data
.
chosed
=
true
;
// 判断此行是否完成
let
lineFull
=
this
.
answerArr
.
length
==
GameNGT14
.
getIns
().
getCurrent
().
answer
.
length
;
if
(
lineFull
)
{
this
.
answerArr
.
forEach
(
nd
=>
{
nd
.
off
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
onItemTouchStart
,
this
);
nd
.
off
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
,
this
.
onItemTouchMove
,
this
);
nd
.
off
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onItemTouchEnd
,
this
);
nd
.
off
(
cc
.
Node
.
EventType
.
TOUCH_CANCEL
,
this
.
onItemTouchCancel
,
this
);
nd
.
active
=
false
;
this
.
answerArr
.
forEach
(
ans
=>
{
ans
.
nd
.
off
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
onItemTouchStart
,
this
);
ans
.
nd
.
off
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
,
this
.
onItemTouchMove
,
this
);
ans
.
nd
.
off
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onItemTouchEnd
,
this
);
ans
.
nd
.
off
(
cc
.
Node
.
EventType
.
TOUCH_CANCEL
,
this
.
onItemTouchCancel
,
this
);
ans
.
nd
.
active
=
false
;
this
.
updateCurrentNodeColor
(
ans
.
bg
,
ans
.
nd
.
data
);
})
let
nodes
=
this
.
getHightLightNodes
();
...
...
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