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
e975e26a
Commit
e975e26a
authored
Oct 27, 2022
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拖拽完成
parent
58994e8b
Changes
12
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
742 additions
and
173 deletions
+742
-173
error.mp3
assets/cocos_generator/audios/error.mp3
+0
-0
error.mp3.meta
assets/cocos_generator/audios/error.mp3.meta
+7
-0
move.mp3
assets/cocos_generator/audios/move.mp3
+0
-0
move.mp3.meta
assets/cocos_generator/audios/move.mp3.meta
+7
-0
next_question.mp3
assets/cocos_generator/audios/next_question.mp3
+0
-0
next_question.mp3.meta
assets/cocos_generator/audios/next_question.mp3.meta
+7
-0
right.mp3
assets/cocos_generator/audios/right.mp3
+0
-0
right.mp3.meta
assets/cocos_generator/audios/right.mp3.meta
+7
-0
right_wrong.mp3
assets/cocos_generator/audios/right_wrong.mp3
+0
-0
right_wrong.mp3.meta
assets/cocos_generator/audios/right_wrong.mp3.meta
+7
-0
cocos_generator.fire
assets/cocos_generator/scene/cocos_generator.fire
+668
-148
cocos_generator.ts
assets/cocos_generator/scene/cocos_generator.ts
+39
-25
No files found.
assets/cocos_generator/audios/error.mp3
0 → 100644
View file @
e975e26a
File added
assets/cocos_generator/audios/error.mp3.meta
0 → 100644
View file @
e975e26a
{
"ver": "2.0.1",
"uuid": "aa5dce85-83fb-44b4-817f-245e86d4bde9",
"downloadMode": 0,
"duration": 0.556563,
"subMetas": {}
}
\ No newline at end of file
assets/cocos_generator/audios/move.mp3
0 → 100644
View file @
e975e26a
File added
assets/cocos_generator/audios/move.mp3.meta
0 → 100644
View file @
e975e26a
{
"ver": "2.0.1",
"uuid": "433c5b0a-ebaa-4398-90aa-5e0d8ce58189",
"downloadMode": 0,
"duration": 0.39185,
"subMetas": {}
}
\ No newline at end of file
assets/cocos_generator/audios/next_question.mp3
0 → 100644
View file @
e975e26a
File added
assets/cocos_generator/audios/next_question.mp3.meta
0 → 100644
View file @
e975e26a
{
"ver": "2.0.1",
"uuid": "1df07874-8c2a-4e48-871b-9550d01c9e5f",
"downloadMode": 0,
"duration": 2.403265,
"subMetas": {}
}
\ No newline at end of file
assets/cocos_generator/audios/right.mp3
0 → 100644
View file @
e975e26a
File added
assets/cocos_generator/audios/right.mp3.meta
0 → 100644
View file @
e975e26a
{
"ver": "2.0.1",
"uuid": "bfa2aa31-940a-47ed-b340-9a682440aab0",
"downloadMode": 0,
"duration": 1.959184,
"subMetas": {}
}
\ No newline at end of file
assets/cocos_generator/audios/right_wrong.mp3
0 → 100644
View file @
e975e26a
File added
assets/cocos_generator/audios/right_wrong.mp3.meta
0 → 100644
View file @
e975e26a
{
"ver": "2.0.1",
"uuid": "d1f740c5-6b88-4cec-8a02-151be9cefe61",
"downloadMode": 0,
"duration": 0.938688,
"subMetas": {}
}
\ No newline at end of file
assets/cocos_generator/scene/cocos_generator.fire
View file @
e975e26a
This diff is collapsed.
Click to expand it.
assets/cocos_generator/scene/cocos_generator.ts
View file @
e975e26a
...
...
@@ -194,6 +194,18 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
})
}
// 更新当前面板颜色
updateCurrentNodeColor
(
node
,
data
)
{
let
label
=
node
.
getChildByName
(
'
label
'
)
pg
.
view
.
visible
(
label
,
true
)
pg
.
view
.
setString
(
label
,
data
.
word
)
for
(
let
i
=
1
;
i
<=
5
;
i
++
)
{
pg
.
view
.
visible
(
pg
.
view
.
find
(
node
,
'
img_keyboard_
'
+
i
),
data
.
color
==
i
);
}
let
block
=
node
.
data
;
block
.
val
=
data
.
word
;
}
getBlockNodeByPos
(
x
,
y
)
{
return
this
.
layout_blocks
.
children
.
find
(
node
=>
node
.
data
.
x
==
x
&&
node
.
data
.
y
==
y
)
}
...
...
@@ -284,16 +296,31 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
touching
=
null
;
target
.
x
=
target
.
data
.
pos
.
x
;
target
.
y
=
target
.
data
.
pos
.
y
;
// this.playLocalAudio('error').then(() => {
// this.touching = null;
// // this.updateItem(target, data);
// })
return
;
}
//是否正确
let
isRight
=
collNode
.
data
.
rightVal
==
data
.
word
;
if
(
isRight
)
{
this
.
playLocalAudio
(
'
move
'
).
then
(()
=>
{
})
let
item
=
target
;
cc
.
tween
(
target
).
to
(
0.15
,
{
scale
:
0.9
,
rotation
:
0
}).
call
(()
=>
{
// block需要显示内容
this
.
updateCurrentNodeColor
(
collNode
,
data
);
target
.
active
=
false
;
this
.
touching
=
null
;
item
.
off
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
onItemTouchStart
,
this
);
item
.
off
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
,
this
.
onItemTouchMove
,
this
);
item
.
off
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onItemTouchEnd
,
this
);
item
.
off
(
cc
.
Node
.
EventType
.
TOUCH_CANCEL
,
this
.
onItemTouchCancel
,
this
);
// 判断此行是否完成
let
lineFull
=
true
;
if
(
lineFull
)
{
}
else
{
// 下一个格子刷新聚焦
this
.
updateHightLight
();
}
}).
start
();
// this.playLocalAudio('right').then(() => {
// if (data.audioUrl) {
// pg.audio.playAudioByUrlThen(data.audioUrl).then(() => {
...
...
@@ -303,22 +330,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
// this.touching = null;
// }
// })
this
.
touching
=
null
;
item
.
off
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
onItemTouchStart
,
this
);
item
.
off
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
,
this
.
onItemTouchMove
,
this
);
item
.
off
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onItemTouchEnd
,
this
);
item
.
off
(
cc
.
Node
.
EventType
.
TOUCH_CANCEL
,
this
.
onItemTouchCancel
,
this
);
}
else
{
// this.playLocalAudio('error').then(() => {
// this.touching = null;
// // this.updateItem(target, data);
// })
this
.
touching
=
null
;
target
.
x
=
target
.
data
.
pos
.
x
;
target
.
y
=
target
.
data
.
pos
.
y
;
}
// target.x = target.data.pos.x;
// target.y = target.data.pos.y;
// 检测一行是否完成, 完成加星星
// pg.event.emit('mouse_05_add')
...
...
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