Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dfzx_cocos_dqq_app
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_app
Commits
15469c46
Commit
15469c46
authored
Mar 23, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:bugs
parent
82ad6a40
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
22 deletions
+34
-22
dfzx_cocos_dqq_app.js
play/assets/dfzx_cocos_dqq_app/scene/dfzx_cocos_dqq_app.js
+34
-22
No files found.
play/assets/dfzx_cocos_dqq_app/scene/dfzx_cocos_dqq_app.js
View file @
15469c46
...
...
@@ -195,6 +195,10 @@ cc.Class({
starLayout
.
zIndex
=
2
;
const
paddingY
=
starLayout
.
getComponent
(
cc
.
Layout
).
spacingY
;
if
(
this
.
data
.
questionList
.
length
==
1
)
{
starLayout
.
active
=
false
;
}
for
(
let
i
=
0
;
i
<
this
.
data
.
questionList
.
length
;
i
++
)
{
const
starBase
=
cc
.
instantiate
(
cc
.
find
(
'
StarBase
'
));
starBase
.
name
=
`starBase_
${
i
}
`
;
...
...
@@ -243,6 +247,7 @@ cc.Class({
await
asyncDelay
(
0.6
);
await
asyncTweenTo
(
starBig
,
0.8
,
{
scale
:
0
},
{
easing
:
'
quadOut
'
});
await
this
.
playAudioSync
(
'
question
'
);
},
isEndGame
()
{
...
...
@@ -267,7 +272,6 @@ cc.Class({
this
.
createStars
();
await
this
.
showGuns
();
await
this
.
playAudioSync
(
'
question
'
);
await
this
.
playQuestionAudio
();
this
.
startShowBalls
();
},
...
...
@@ -363,10 +367,15 @@ cc.Class({
if
(
ball
.
canNotTouch
)
{
return
;
}
if
(
answer
.
rightAnswer
)
{
ball
.
canNotTouch
=
true
;
}
const
location
=
event
.
getLocation
();
await
this
.
shootTarget
(
ball
,
location
,
true
);
if
(
answer
.
rightAnswer
)
{
if
(
!
answer
.
rightAnswer
)
{
this
.
targetLaugh
(
ball
);
return
;
}
this
.
targetDistroy
(
ball
);
this
.
_status
.
currentRightNumber
++
;
const
currentQuestion
=
this
.
data
.
questionList
[
this
.
_status
.
currentQuestionIdx
];
...
...
@@ -385,9 +394,6 @@ cc.Class({
this
.
startShowBalls
();
}
}
}
else
{
this
.
targetLaugh
(
ball
);
}
});
const
currentQuestion
=
this
.
data
.
questionList
[
this
.
_status
.
currentQuestionIdx
];
...
...
@@ -407,11 +413,17 @@ cc.Class({
return
ball
;
},
onBallClicked
(
answer
)
{
},
createImgBall
(
answer
)
{
const
ball
=
cc
.
instantiate
(
cc
.
find
(
'
BallImg
'
));
const
img
=
cc
.
find
(
'
Mask/AnsterImg
'
,
ball
);
const
mask
=
cc
.
find
(
'
Mask
'
,
ball
);
getSpriteFrimeByUrl
(
answer
.
answerImg
,
(
spriteFrame
)
=>
{
img
.
getComponent
(
cc
.
Sprite
).
spriteFrame
=
spriteFrame
;
img
.
scale
=
Math
.
min
(
1
,
mask
.
width
/
img
.
width
,
mask
.
height
/
img
.
height
);
});
return
ball
;
},
...
...
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