Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
east-10
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
east-10
Commits
f350e187
Commit
f350e187
authored
Jun 15, 2021
by
linzhiguo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+ 音效
parent
5a614b84
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
972 additions
and
361 deletions
+972
-361
scene.fire
play/assets/scene/scene/scene.fire
+928
-338
scene.js
play/assets/scene/scene/scene.js
+43
-22
kind.js
play/assets/scene/script/kind.js
+1
-1
No files found.
play/assets/scene/scene/scene.fire
View file @
f350e187
This diff is collapsed.
Click to expand it.
play/assets/scene/scene/scene.js
View file @
f350e187
...
...
@@ -148,11 +148,12 @@ cc.Class({
// let option = option_node.getComponent(cc.js.getClassByName('WordOption'));
this
.
_test
.
on
(
'
click
'
,
()
=>
{
option
.
initType
(
1
);
option
.
setWord
(
'
hello
'
);
});
cc
.
find
(
'
Canvas/add
'
).
on
(
'
click
'
,
()
=>
{
if
(
this
.
_btn_start
.
active
==
true
||
this
.
_btn_restart
.
active
==
true
)
return
;
this
.
pageFinish
();
});
...
...
@@ -176,6 +177,7 @@ cc.Class({
let
option_node
=
area
.
children
[
i
];
let
option
=
option_node
.
getComponent
(
cc
.
js
.
getClassByName
(
'
WordOption
'
));
if
(
this
.
_touched
!=
true
&&
cc
.
rect
(
option_node
.
getBoundingBoxToWorld
()).
contains
(
event
.
touch
.
_point
)){
this
.
playAudioByName
(
'
tap
'
);
this
.
_moved
=
false
;
this
.
_touched
=
true
;
selected
.
copyValues
(
option
);
...
...
@@ -223,12 +225,10 @@ cc.Class({
if
(
cc
.
rect
(
item
.
getBoundingBoxToWorld
()).
intersects
(
cc
.
rect
(
selected
.
node
.
getBoundingBoxToWorld
()))){
let
kind
=
item
.
getComponent
(
cc
.
js
.
getClassByName
(
'
WordKind
'
));
if
(
kind
.
kind_id
!=
selected
.
kind_id
){
console
.
log
(
kind
.
kind_id
);
console
.
log
(
selected
.
kind_id
);
this
.
playAudioByName
(
'
incorrect
'
);
break
;
}
this
.
playAudioByName
(
'
correct
'
);
let
node
=
cc
.
instantiate
(
cc
.
find
(
'
res/option_item
'
));
let
ot
=
node
.
getComponent
(
cc
.
js
.
getClassByName
(
'
WordOption
'
));
ot
.
copyValues
(
selected
);
...
...
@@ -254,21 +254,25 @@ cc.Class({
initButton
(){
this
.
_btn_start
=
cc
.
find
(
'
Canvas/btn_start
'
);
this
.
_btn_start
.
on
(
'
click
'
,
()
=>
{
this
.
playAudioByName
(
'
button
'
);
this
.
_btn_start
.
active
=
false
;
this
.
updateData
();
this
.
upForeground
(()
=>
{
this
.
_moved
=
true
;
this
.
playAudioByName
(
'
up
'
);
});
});
this
.
_btn_start
.
active
=
true
;
this
.
_btn_restart
=
cc
.
find
(
'
Canvas/btn_restart
'
);
this
.
_btn_restart
.
on
(
'
click
'
,
()
=>
{
this
.
playAudioByName
(
'
button
'
);
this
.
_btn_restart
.
active
=
false
;
this
.
downForeground
(()
=>
{
this
.
_btn_start
.
active
=
true
;
this
.
resetData
();
});
// this.downForeground(()=>{
// this._btn_start.active = true;
// this.resetData();
// });
this
.
resetData
();
});
},
...
...
@@ -341,7 +345,7 @@ cc.Class({
},
currentStarIdx
:
null
,
showStar
()
{
showStar
(
cb
)
{
if
(
!
this
.
currentStarIdx
)
{
this
.
currentStarIdx
=
0
;
}
...
...
@@ -386,7 +390,7 @@ cc.Class({
.
delay
(
0.6
)
.
to
(
0.8
,
{
scale
:
0
},
{
easing
:
'
quadOut
'
})
.
call
(()
=>
{
// this.checkGameEnd
();
cb
&&
cb
();
})
.
start
();
...
...
@@ -525,21 +529,38 @@ cc.Class({
pageFinish
(){
this
.
_page_idx
++
;
if
(
this
.
_page_idx
>=
this
.
_page_max
){
this
.
showStar
();
this
.
_star_idx
++
;
if
(
this
.
_star_idx
>=
this
.
data
.
stars
.
length
){
this
.
completeTest
();
return
;
this
.
downForeground
(()
=>
{
if
(
this
.
_page_idx
>=
this
.
_page_max
){
this
.
playAudioByName
(
'
star
'
);
this
.
playAudioByName
(
'
complete
'
);
this
.
showStar
(()
=>
{
this
.
_star_idx
++
;
if
(
this
.
_star_idx
>=
this
.
data
.
stars
.
length
){
this
.
completeTest
();
return
;
}
this
.
_page_max
=
this
.
data
.
stars
[
this
.
_star_idx
].
length
;
this
.
_page_idx
=
0
;
this
.
upForeground
(()
=>
{
this
.
updateData
();
this
.
playAudioByName
(
'
up
'
);
});
});
}
this
.
_page_max
=
this
.
data
.
stars
[
this
.
_star_idx
].
length
;
this
.
_page_idx
=
0
;
}
this
.
updateData
();
else
{
this
.
upForeground
(()
=>
{
this
.
updateData
();
this
.
playAudioByName
(
'
up
'
);
});
}
});
},
completeTest
(){
this
.
completeAnimation
();
this
.
playAudioByName
(
'
sahua
'
);
this
.
playAudioByName
(
'
button
'
);
this
.
playAudioByName
(
'
up
'
);
this
.
_btn_restart
.
active
=
true
;
this
.
_moved
=
false
;
//this.resetData();
...
...
play/assets/scene/script/kind.js
View file @
f350e187
...
...
@@ -64,7 +64,7 @@ cc.Class({
this
.
btn_sound
.
node
.
active
=
true
;
}
this
.
kind_id
=
data
.
kind
;
//
this.layout.node.removeAllChildren();
this
.
layout
.
node
.
removeAllChildren
();
},
initData
(){
...
...
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