Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dfzx_cocos_dqq
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
dfzx_cocos_dqq
Commits
bc14a8c0
Commit
bc14a8c0
authored
Mar 23, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 解决重叠问题;选项正确后读音
parent
18850446
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
dfzx_cocos_dqq.js
play/assets/dfzx_cocos_dqq/scene/dfzx_cocos_dqq.js
+21
-3
No files found.
play/assets/dfzx_cocos_dqq/scene/dfzx_cocos_dqq.js
View file @
bc14a8c0
...
...
@@ -324,6 +324,7 @@ cc.Class({
}
},
createBall
(
answer
)
{
let
ball
=
null
;
if
(
answer
.
answerType
==
'
img
'
)
{
...
...
@@ -331,11 +332,24 @@ cc.Class({
}
else
{
ball
=
this
.
createTextBall
(
answer
);
}
const
bg
=
cc
.
find
(
'
Canvas/bg
'
);
ball
.
x
=
bg
.
width
/
4
*
(
RandomInt
(
0
,
3
)
-
1
)
+
RandomInt
(
-
50
,
50
);
let
ballPosXBaseList
=
[
-
bg
.
width
/
4
,
0
,
bg
.
width
/
4
];
if
(
this
.
lastBallPosXBase
!==
undefined
)
{
ballPosXBaseList
=
ballPosXBaseList
.
filter
(
posX
=>
posX
!=
this
.
lastBallPosXBase
);
}
const
ballPosXBase
=
ballPosXBaseList
[
RandomInt
(
ballPosXBaseList
.
length
)];
ball
.
x
=
ballPosXBase
+
RandomInt
(
-
50
,
50
);
ball
.
y
=
-
bg
.
height
;
ball
.
parent
=
bg
;
this
.
lastBallPosXBase
=
ballPosXBase
;
if
(
answer
.
rightAnswer
)
{
ball
.
audio
=
answer
.
answerAudio
;
}
cc
.
tween
(
ball
.
getChildByName
(
'
bg
'
))
.
to
(
0.2
,
{
scaleX
:
0.98
,
scaleY
:
1.05
})
.
to
(
0.2
,
{
scaleX
:
1.02
,
scaleY
:
0.94
})
...
...
@@ -383,7 +397,7 @@ cc.Class({
const
time2
=
time
-
time1
;
cc
.
tween
(
ball
)
.
to
(
time1
,
{
y
:
bg
.
height
/
2
-
ball
.
height
/
2
-
50
},
{
easing
:
'
quadOut
'
})
.
delay
(
0.
7
5
)
.
delay
(
0.5
)
.
to
(
time2
,
{
y
:
bg
.
height
},
{
easing
:
'
quadIn
'
})
.
removeSelf
()
.
start
();
...
...
@@ -505,7 +519,7 @@ cc.Class({
},
async
targetDistroy
(
node
)
{
this
.
playAudio
(
'
right
'
);
node
.
stopAllActions
(
);
const
bg
=
node
.
getChildByName
(
'
bg
'
);
bg
.
active
=
false
;
const
DistroyAnime
=
node
.
getChildByName
(
'
DistroyAnime
'
);
...
...
@@ -514,6 +528,10 @@ cc.Class({
cc
.
tween
(
Mask
)
.
to
(
0.5
,
{
opacity
:
0
})
.
start
();
await
this
.
playAudioSync
(
'
right
'
);
await
playAudioByUrlSync
(
node
.
audio
);
node
.
removeFromParent
();
},
async
targetLaugh
(
node
)
{
...
...
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