Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JJ_Game_03
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
JJ_Game_03
Commits
11b9a26c
Commit
11b9a26c
authored
Dec 27, 2023
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: debug
parent
bf32a77e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
JJ_Game_03.js
assets/JJ_Game_03/scene/JJ_Game_03.js
+30
-0
No files found.
assets/JJ_Game_03/scene/JJ_Game_03.js
View file @
11b9a26c
...
@@ -168,18 +168,27 @@ cc.Class({
...
@@ -168,18 +168,27 @@ cc.Class({
const
BtnStart
=
cc
.
find
(
'
Canvas/bg/BtnStart
'
);
const
BtnStart
=
cc
.
find
(
'
Canvas/bg/BtnStart
'
);
addBtnListener
(
BtnStart
,
async
()
=>
{
addBtnListener
(
BtnStart
,
async
()
=>
{
await
asyncTweenTo
(
BtnStart
,
0.1
,
{
opacity
:
0
});
await
asyncTweenTo
(
BtnStart
,
0.1
,
{
opacity
:
0
});
if
(
this
.
isDestroy
)
{
return
;
}
BtnStart
.
active
=
false
;
BtnStart
.
active
=
false
;
this
.
gameStart
();
this
.
gameStart
();
},
this
.
playAudio
.
bind
(
this
,
'
btn
'
));
},
this
.
playAudio
.
bind
(
this
,
'
btn
'
));
const
BtnRestart
=
cc
.
find
(
'
Canvas/bg/BtnRestart
'
);
const
BtnRestart
=
cc
.
find
(
'
Canvas/bg/BtnRestart
'
);
addBtnListener
(
BtnRestart
,
async
()
=>
{
addBtnListener
(
BtnRestart
,
async
()
=>
{
await
asyncTweenTo
(
BtnRestart
,
0.1
,
{
opacity
:
0
});
await
asyncTweenTo
(
BtnRestart
,
0.1
,
{
opacity
:
0
});
if
(
this
.
isDestroy
)
{
return
;
}
BtnRestart
.
active
=
false
;
BtnRestart
.
active
=
false
;
this
.
gameStart
();
this
.
gameStart
();
},
this
.
playAudio
.
bind
(
this
,
'
btn
'
));
},
this
.
playAudio
.
bind
(
this
,
'
btn
'
));
const
BtnSpeaker
=
cc
.
find
(
'
Canvas/bg/BtnSpeaker
'
);
const
BtnSpeaker
=
cc
.
find
(
'
Canvas/bg/BtnSpeaker
'
);
addBtnListener
(
BtnSpeaker
,
async
()
=>
{
addBtnListener
(
BtnSpeaker
,
async
()
=>
{
await
this
.
playQuestionAudio
();
await
this
.
playQuestionAudio
();
if
(
this
.
isDestroy
)
{
return
;
}
});
});
const
bg
=
cc
.
find
(
'
Canvas/bg
'
);
const
bg
=
cc
.
find
(
'
Canvas/bg
'
);
...
@@ -289,8 +298,14 @@ cc.Class({
...
@@ -289,8 +298,14 @@ cc.Class({
};
};
this
.
createStars
();
this
.
createStars
();
await
this
.
showGuns
();
await
this
.
showGuns
();
if
(
this
.
isDestroy
)
{
return
;
}
await
this
.
playQuestionAudio
();
await
this
.
playQuestionAudio
();
if
(
this
.
isDestroy
)
{
return
;
}
this
.
startShowBalls
();
this
.
startShowBalls
();
},
},
...
@@ -395,6 +410,9 @@ cc.Class({
...
@@ -395,6 +410,9 @@ cc.Class({
}
}
const
location
=
event
.
getLocation
();
const
location
=
event
.
getLocation
();
await
this
.
shootTarget
(
ball
,
location
,
true
);
await
this
.
shootTarget
(
ball
,
location
,
true
);
if
(
this
.
isDestroy
)
{
return
;
}
if
(
!
answer
.
rightAnswer
)
{
if
(
!
answer
.
rightAnswer
)
{
this
.
targetLaugh
(
ball
);
this
.
targetLaugh
(
ball
);
return
;
return
;
...
@@ -407,14 +425,26 @@ cc.Class({
...
@@ -407,14 +425,26 @@ cc.Class({
this
.
gameNextFlag
=
true
;
this
.
gameNextFlag
=
true
;
this
.
stopShowBalls
();
this
.
stopShowBalls
();
await
asyncDelay
(
0.5
);
await
asyncDelay
(
0.5
);
if
(
this
.
isDestroy
)
{
return
;
}
await
this
.
showStar
();
await
this
.
showStar
();
if
(
this
.
isDestroy
)
{
return
;
}
this
.
_status
.
currentRightNumber
=
0
;
this
.
_status
.
currentRightNumber
=
0
;
this
.
_status
.
currentQuestionIdx
++
;
this
.
_status
.
currentQuestionIdx
++
;
if
(
this
.
isEndGame
())
{
if
(
this
.
isEndGame
())
{
this
.
onGameEnd
();
this
.
onGameEnd
();
}
else
{
}
else
{
await
asyncDelay
(
1.5
);
await
asyncDelay
(
1.5
);
if
(
this
.
isDestroy
)
{
return
;
}
await
this
.
playQuestionAudio
();
await
this
.
playQuestionAudio
();
if
(
this
.
isDestroy
)
{
return
;
}
this
.
startShowBalls
();
this
.
startShowBalls
();
}
}
this
.
gameNextFlag
=
false
;
this
.
gameNextFlag
=
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