Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
Coloring
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
Commits
c86fc58a
Commit
c86fc58a
authored
Apr 07, 2022
by
张世斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修复bug
parent
49fc61f9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
4 deletions
+26
-4
Coloring.fire
assets/Coloring/scene/Coloring.fire
+1
-1
Coloring.js
assets/Coloring/scene/Coloring.js
+25
-3
No files found.
assets/Coloring/scene/Coloring.fire
View file @
c86fc58a
...
@@ -850,7 +850,7 @@
...
@@ -850,7 +850,7 @@
"__id__": 14
"__id__": 14
},
},
"_children": [],
"_children": [],
"_active":
fals
e,
"_active":
tru
e,
"_components": [
"_components": [
{
{
"__id__": 16
"__id__": 16
...
...
assets/Coloring/scene/Coloring.js
View file @
c86fc58a
import
{
onHomeworkFinish
,
RandomInt
,
playAudio
,
playDragonBoneAnimation
}
from
"
../script/util
"
;
import
{
onHomeworkFinish
,
RandomInt
,
playAudio
,
playDragonBoneAnimation
,
asyncDelay
}
from
"
../script/util
"
;
import
{
defaultData
}
from
"
../script/defaultData
"
;
import
{
defaultData
}
from
"
../script/defaultData
"
;
cc
.
Class
({
cc
.
Class
({
...
@@ -130,6 +130,7 @@ cc.Class({
...
@@ -130,6 +130,7 @@ cc.Class({
this
.
bindColorButton
(
item
);
this
.
bindColorButton
(
item
);
}
}
// this._alligator = this.bindAlligator(this.paint);
// this._alligator = this.bindAlligator(this.paint);
// this._alligator2 = this.bindAlligator(this.paint2);
// this._alligator2 = this.bindAlligator(this.paint2);
this
.
_alligator
=
this
.
paint
.
getChildByName
(
"
alligator
"
);
//children[0];//this.bindAlligator(this.paint);
this
.
_alligator
=
this
.
paint
.
getChildByName
(
"
alligator
"
);
//children[0];//this.bindAlligator(this.paint);
...
@@ -167,7 +168,9 @@ cc.Class({
...
@@ -167,7 +168,9 @@ cc.Class({
});
});
}
}
this
.
paint
.
on
(
"
click
"
,()
=>
{
this
.
paint
.
on
(
"
click
"
,
async
()
=>
{
await
asyncDelay
(
0.5
);
cc
.
log
(
"
btnCoolCat
"
);
if
(
this
.
_can_tap
!=
true
)
if
(
this
.
_can_tap
!=
true
)
return
;
return
;
this
.
_can_tap
=
false
;
this
.
_can_tap
=
false
;
...
@@ -398,17 +401,25 @@ cc.Class({
...
@@ -398,17 +401,25 @@ cc.Class({
// });
// });
const
btnCoolCat
=
cc
.
find
(
'
Canvas/bg/bottom_area/BtnCoolCat
'
);
const
btnCoolCat
=
cc
.
find
(
'
Canvas/bg/bottom_area/BtnCoolCat
'
);
btnCoolCat
.
off
(
"
click
"
);
btnCoolCat
.
on
(
'
click
'
,
()
=>
{
btnCoolCat
.
on
(
'
click
'
,
()
=>
{
if
(
!
this
.
_can_tap
){
return
;
}
this
.
_can_tap
=
false
;
const
btn
=
cc
.
find
(
'
Canvas/bg/btnReplay
'
);
const
btn
=
cc
.
find
(
'
Canvas/bg/btnReplay
'
);
cc
.
audioEngine
.
stop
();
if
(
btn
.
active
)
{
if
(
btn
.
active
)
{
playDragonBoneAnimation
(
this
.
coolcat
,
'
finish
'
,
-
1
);
playDragonBoneAnimation
(
this
.
coolcat
,
'
finish
'
,
-
1
);
this
.
playAudioByUrl
(
this
.
data
.
finishAudio
,
()
=>
{
this
.
playAudioByUrl
(
this
.
data
.
finishAudio
,
()
=>
{
playDragonBoneAnimation
(
this
.
coolcat
,
'
normal
'
,
-
1
);
playDragonBoneAnimation
(
this
.
coolcat
,
'
normal
'
,
-
1
);
this
.
_can_tap
=
true
;
});
});
}
else
{
}
else
{
playDragonBoneAnimation
(
this
.
coolcat
,
'
begin
'
,
-
1
);
playDragonBoneAnimation
(
this
.
coolcat
,
'
begin
'
,
-
1
);
this
.
playAudioByUrl
(
this
.
data
.
startAudio
,
()
=>
{
this
.
playAudioByUrl
(
this
.
data
.
startAudio
,
()
=>
{
playDragonBoneAnimation
(
this
.
coolcat
,
'
normal
'
,
-
1
);
playDragonBoneAnimation
(
this
.
coolcat
,
'
normal
'
,
-
1
);
this
.
_can_tap
=
true
;
});
});
}
}
});
});
...
@@ -419,6 +430,12 @@ cc.Class({
...
@@ -419,6 +430,12 @@ cc.Class({
this
.
cleanColor
();
this
.
cleanColor
();
this
.
coolcat
.
active
=
true
;
this
.
coolcat
.
active
=
true
;
this
.
color_selector
.
active
=
true
;
// this.color_selector.x = this.color_buttons[0].x;
// this.color_selector.y = this.color_buttons[0].y;
this
.
_color
=
this
.
getColor
(
"
f8ed21
"
);
let
spriteFrame
=
await
this
.
getSpriteFrimeByUrl
(
this
.
data
.
bg
);
let
spriteFrame
=
await
this
.
getSpriteFrimeByUrl
(
this
.
data
.
bg
);
let
bg1
=
this
.
paint
.
getChildByName
(
"
bg_img
"
);
let
bg1
=
this
.
paint
.
getChildByName
(
"
bg_img
"
);
// this.log("bg:"+bg1.name);
// this.log("bg:"+bg1.name);
...
@@ -456,6 +473,7 @@ cc.Class({
...
@@ -456,6 +473,7 @@ cc.Class({
playDragonBoneAnimation
(
this
.
coolcat
,
'
normal
'
,
-
1
);
playDragonBoneAnimation
(
this
.
coolcat
,
'
normal
'
,
-
1
);
this
.
_can_tap
=
true
;
this
.
_can_tap
=
true
;
})
})
// this.playAudioByName('demo', () => {
// this.playAudioByName('demo', () => {
// playDragonBoneAnimation(this.coolcat, 'normal');
// playDragonBoneAnimation(this.coolcat, 'normal');
// this._can_tap = true;
// this._can_tap = true;
...
@@ -470,7 +488,10 @@ cc.Class({
...
@@ -470,7 +488,10 @@ cc.Class({
btn
.
active
=
true
;
btn
.
active
=
true
;
btn
.
canClick
=
true
;
btn
.
canClick
=
true
;
btn
.
on
(
'
click
'
,
()
=>
{
console
.
log
(
'
汪汪汪
'
);
cc
.
director
.
loadScene
(
'
Coloring
'
);
});
const
circle
=
cc
.
find
(
'
Canvas/bg/btnReplay/bg_circle
'
);
const
circle
=
cc
.
find
(
'
Canvas/bg/btnReplay/bg_circle
'
);
cc
.
tween
(
circle
)
cc
.
tween
(
circle
)
.
set
({
scale
:
0.8
,
opacity
:
255
})
.
set
({
scale
:
0.8
,
opacity
:
255
})
...
@@ -658,6 +679,7 @@ cc.Class({
...
@@ -658,6 +679,7 @@ cc.Class({
return
;
return
;
this
.
_can_tap
=
false
;
this
.
_can_tap
=
false
;
cc
.
log
(
"
btn teeth
"
);
// clearTimeout(this.paintTimeID);
// clearTimeout(this.paintTimeID);
//correct
//correct
playDragonBoneAnimation
(
this
.
coolcat
,
'
right
'
,
-
1
);
playDragonBoneAnimation
(
this
.
coolcat
,
'
right
'
,
-
1
);
...
...
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