Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
Coloring_OL
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
Coloring_OL
Commits
3637a917
Commit
3637a917
authored
Jul 06, 2022
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 点击有时不好用
parent
f34df367
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
9 deletions
+23
-9
.DS_Store
.DS_Store
+0
-0
Coloring_OL.js
assets/Coloring_OL/scene/Coloring_OL.js
+23
-9
No files found.
.DS_Store
View file @
3637a917
No preview for this file type
assets/Coloring_OL/scene/Coloring_OL.js
View file @
3637a917
...
...
@@ -206,8 +206,10 @@ cc.Class({
// this.playAudioByName('click');
// });
// }
this
.
paint
.
on
(
"
click
"
,
async
()
=>
{
await
asyncDelay
(
0.5
);
this
.
paint
.
on
(
"
touchstart
"
,
async
()
=>
{
cc
.
log
(
"
paint 点击```
"
);
await
asyncDelay
(
0.001
);
if
(
this
.
_can_tap
!=
true
)
return
;
this
.
_can_tap
=
false
;
...
...
@@ -276,11 +278,11 @@ cc.Class({
for
(
let
i
=
0
;
i
<
this
.
data
.
images
.
length
;
i
++
){
let
image
=
this
.
data
.
images
[
i
];
let
tooth
=
await
this
.
getSprNodeByUrl
(
image
.
img
);
//
parent.addChild(tooth);
parent
.
addChild
(
tooth
);
parent
.
parent
.
addChild
(
tooth
,
5
);
tooth
.
x
+=
parent
.
x
;
tooth
.
y
+=
parent
.
y
;
//
parent.parent.addChild(tooth, 5);
//
tooth.x += parent.x;
//
tooth.y += parent.y;
// tooth.color = cc.Color.WHITE;
tooth
.
painted
=
null
;
...
...
@@ -357,6 +359,7 @@ cc.Class({
},
getDefaultData
()
{
// return {"startAudio":"https://staging-teach.cdn.ireadabc.com/c0ab05fa5a866dd8e3f255f6818e5270.mp3","waitAudio":"https://staging-teach.cdn.ireadabc.com/c0ab05fa5a866dd8e3f255f6818e5270.mp3","finishAudio":"https://staging-teach.cdn.ireadabc.com/126c125b051954d3b5eec1b5a63cb309.mp3","finishWaitAudio":"https://staging-teach.cdn.ireadabc.com/6162b1d0ce9c0a46ac1b6a03eb2768c3.mp3","rightAudio":"https://teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8.mp3","wrongAudio":"https://teach.cdn.ireadabc.com/1ebdd8267b0f9161f1b6b83a3b44fb4b.mp3","bg":"https://staging-teach.cdn.ireadabc.com/7a8ce0871844b13212e23a7f174a7914.png","images":[{"img":"https://staging-teach.cdn.ireadabc.com/b04e6aabab9ba17d5236ff91bbfdd619.png"},{"img":"https://staging-teach.cdn.ireadabc.com/5611fe1930af2e03424319b345153d09.png"},{"img":"https://staging-teach.cdn.ireadabc.com/7398639bec9bc98580cd9812635d505f.png"},{"img":"https://staging-teach.cdn.ireadabc.com/e962deb78221cb6b2c518d64d9e227d7.png"}]}
return
defaultData
;
},
...
...
@@ -1128,6 +1131,9 @@ cc.Class({
const
canvas
=
cc
.
find
(
'
Canvas
'
);
const
bg
=
this
.
getSprNode
(
'
online_bg
'
);
bg
.
scale
=
this
.
_mapScaleMax
*
2
;
bg
.
addComponent
(
cc
.
Button
);
canvas
.
addChild
(
bg
,
5
);
this
.
resultView
=
bg
;
...
...
@@ -1192,6 +1198,9 @@ cc.Class({
playDragonBoneAnimation
(
this
.
coolcat
,
'
begin
'
,
-
1
);
this
.
playAudioByName
(
'
result_
'
+
id
,
()
=>
{
playDragonBoneAnimation
(
this
.
coolcat
,
'
normal
'
);
onHomeworkFinish
();
});
},
...
...
@@ -1588,7 +1597,6 @@ cc.Class({
}
this
.
isGameEnd
=
true
;
this
.
showResultView
()
onHomeworkFinish
();
},
// gameEnd(){
...
...
@@ -1633,7 +1641,10 @@ cc.Class({
let
sprite
=
tooth
;
// sprite.word.node.color = cc.Color.WHITE;
sprite
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
()
=>
{
sprite
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
(
e
)
=>
{
e
.
stopPropagation
();
if
(
this
.
_can_tap
!=
true
)
return
;
...
...
@@ -1654,6 +1665,8 @@ cc.Class({
playDragonBoneAnimation
(
this
.
coolcat
,
'
right
'
,
-
1
);
this
.
playAudioByName
(
'
correct
'
,
()
=>
{
playDragonBoneAnimation
(
this
.
coolcat
,
'
normal
'
);
console
.
log
(
'
~ this._can_tap = true;
'
)
this
.
_can_tap
=
true
;
});
this
.
playAudioByName
(
'
painted
'
);
...
...
@@ -1756,9 +1769,10 @@ cc.Class({
rt
.
destroy
();
}
console
.
log
(
'
data~ :
'
,
data
);
//
console.log('data~ : ', data);
if
(
data
[
3
]
>
0
)
{
console
.
log
(
"
return true
"
);
return
true
;
}
else
{
return
false
;
...
...
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