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
6909e0d2
Commit
6909e0d2
authored
Mar 23, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:bugs
parent
505ec76e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
27 deletions
+39
-27
dfzx_cocos_dqq.fire
play/assets/dfzx_cocos_dqq/scene/dfzx_cocos_dqq.fire
+5
-5
dfzx_cocos_dqq.js
play/assets/dfzx_cocos_dqq/scene/dfzx_cocos_dqq.js
+34
-22
No files found.
play/assets/dfzx_cocos_dqq/scene/dfzx_cocos_dqq.fire
View file @
6909e0d2
...
...
@@ -3164,8 +3164,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width":
20
0,
"height":
20
0
"width":
4
0,
"height":
4
0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
...
...
@@ -3220,7 +3220,7 @@
"__uuid__": "8cdb44ac-a3f6-449f-b354-7cd48cf84061"
},
"_type": 0,
"_sizeMode":
0
,
"_sizeMode":
2
,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
...
...
@@ -3782,7 +3782,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"_id": "
b32fignA1E/ZHx1Ogc9aIC
"
"_id": "
4bOpy++iVNpZm87WDUy2YY
"
},
{
"__type__": "cc.Label",
...
...
@@ -3817,7 +3817,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "
51w5xnPDZPu5aHqpFiXcJd
"
"_id": "
75K4dvb4tMIrR6eMzEciLa
"
},
{
"__type__": "cc.RichText",
...
...
play/assets/dfzx_cocos_dqq/scene/dfzx_cocos_dqq.js
View file @
6909e0d2
...
...
@@ -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,30 +367,32 @@ cc.Class({
if
(
ball
.
canNotTouch
)
{
return
;
}
ball
.
canNotTouch
=
true
;
if
(
answer
.
rightAnswer
)
{
ball
.
canNotTouch
=
true
;
}
const
location
=
event
.
getLocation
();
await
this
.
shootTarget
(
ball
,
location
,
true
);
if
(
answer
.
rightAnswer
)
{
this
.
targetDistroy
(
ball
);
this
.
_status
.
currentRightNumber
++
;
const
currentQuestion
=
this
.
data
.
questionList
[
this
.
_status
.
currentQuestionIdx
];
this
.
updateRightNumber
();
if
(
this
.
_status
.
currentRightNumber
>=
currentQuestion
.
rigthNumber
)
{
this
.
stopShowBalls
();
await
asyncDelay
(
0.5
);
await
this
.
showStar
();
this
.
_status
.
currentRightNumber
=
0
;
this
.
_status
.
currentQuestionIdx
++
;
if
(
this
.
isEndGame
())
{
this
.
onGameEnd
();
}
else
{
await
asyncDelay
(
1.5
);
await
this
.
playQuestionAudio
();
this
.
startShowBalls
();
}
}
}
else
{
if
(
!
answer
.
rightAnswer
)
{
this
.
targetLaugh
(
ball
);
return
;
}
this
.
targetDistroy
(
ball
);
this
.
_status
.
currentRightNumber
++
;
const
currentQuestion
=
this
.
data
.
questionList
[
this
.
_status
.
currentQuestionIdx
];
this
.
updateRightNumber
();
if
(
this
.
_status
.
currentRightNumber
>=
currentQuestion
.
rigthNumber
)
{
this
.
stopShowBalls
();
await
asyncDelay
(
0.5
);
await
this
.
showStar
();
this
.
_status
.
currentRightNumber
=
0
;
this
.
_status
.
currentQuestionIdx
++
;
if
(
this
.
isEndGame
())
{
this
.
onGameEnd
();
}
else
{
await
asyncDelay
(
1.5
);
await
this
.
playQuestionAudio
();
this
.
startShowBalls
();
}
}
});
...
...
@@ -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