Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JJ_Game_10
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_10
Commits
26e38797
Commit
26e38797
authored
Aug 23, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
退出时清空异步
parent
d631d85a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
11 deletions
+36
-11
GameLogic_JJ_Game_10.js
assets/JJ_Game_10/script/GameLogic_JJ_Game_10.js
+32
-11
JJ_Game_10.js
assets/JJ_Game_10/script/JJ_Game_10.js
+4
-0
No files found.
assets/JJ_Game_10/script/GameLogic_JJ_Game_10.js
View file @
26e38797
...
...
@@ -26,6 +26,9 @@ export default class GameLogic_JJ_Game_10 {
m_isPlayingAudio
=
false
;
m_sysIntervalId
=
null
;
m_setTimeoutIds
=
[];
m_setIntervalIds
=
[];
constructor
(
formData
,
systemOption
)
{
this
.
g_systemOption
=
systemOption
;
this
.
g_imageResList
=
this
.
g_systemOption
.
imageResList
;
...
...
@@ -151,9 +154,10 @@ export default class GameLogic_JJ_Game_10 {
let
a
=
btn_lion
.
node
.
getComponent
(
dragonBones
.
ArmatureDisplay
)
a
.
playAnimation
(
aniName
,
1
);
setTimeout
(()
=>
{
this
.
m_setTimeoutIds
.
push
(
setTimeout
(()
=>
{
a
.
playAnimation
(
aniName
,
-
1
);
},
3200
)
;
},
3200
)
)
}
...
...
@@ -178,6 +182,7 @@ export default class GameLogic_JJ_Game_10 {
currentIdx
++
;
speakers
[
currentIdx
%
num
].
active
=
true
;
},
200
);
this
.
m_setIntervalIds
.
push
(
intervalId
)
}
btn_speaker
.
stopAni
=
()
=>
{
...
...
@@ -319,7 +324,9 @@ export default class GameLogic_JJ_Game_10 {
}
}
})
},
30
)
},
30
);
this
.
m_setIntervalIds
.
push
(
this
.
m_sysIntervalId
)
}
initStar
()
{
...
...
@@ -428,13 +435,13 @@ export default class GameLogic_JJ_Game_10 {
bubb
.
node
.
getChildByName
(
"
image
"
).
active
=
false
;
for
(
let
i
=
0
;
i
<
8
;
i
++
)
{
_p
.
push
(
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
this
.
m_setTimeoutIds
.
push
(
setTimeout
(()
=>
{
if
(
i
>
1
)
{
bubb
.
node
.
getChildByName
(
`bubble_ani (
${
i
}
)`
).
active
=
false
;
}
bubb
.
node
.
getChildByName
(
`bubble_ani (
${
i
+
1
}
)`
).
active
=
true
;
resolve
()
},
30
*
i
);
},
30
*
i
)
)
;
}))
}
return
Promise
.
all
(
_p
)
...
...
@@ -569,10 +576,10 @@ export default class GameLogic_JJ_Game_10 {
this
.
m_bubblesAll
=
this
.
save
;
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
this
.
m_setTimeoutIds
.
push
(
setTimeout
(()
=>
{
resolve
();
this
.
enableClick
(
"
DestroyBubbles
"
)
},
1100
)
;
},
1100
)
)
})
}
...
...
@@ -613,12 +620,12 @@ export default class GameLogic_JJ_Game_10 {
bubble
.
move
.
vX
=
vArr
[
count
%
4
].
vX
bubble
.
move
.
vY
=
vArr
[
count
%
4
].
vY
count
++
;
setTimeout
(()
=>
{
this
.
m_setTimeoutIds
.
push
(
setTimeout
(()
=>
{
this
.
g_cartoon
.
playAudio
(
"
出现
"
)
this
.
g_cartoon
.
tweenChange
(
bubble
.
node
,
{
scale
:
this
.
m_maxScale
,
x
:
bubble
.
move
.
x
,
y
:
bubble
.
move
.
y
},
3
,
_
=>
{
resolve
()
})
},
200
*
index
)
;
},
200
*
index
)
)
})
pAll
.
push
(
_p
)
}
...
...
@@ -682,9 +689,9 @@ export default class GameLogic_JJ_Game_10 {
asyncDelay
(
time
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
this
.
m_setTimeoutIds
.
push
(
setTimeout
(()
=>
{
resolve
();
},
time
*
1000
)
;
},
time
*
1000
)
)
})
}
...
...
@@ -863,6 +870,20 @@ export default class GameLogic_JJ_Game_10 {
// Common function
onDestroy
()
{
console
.
log
(
"
onDestroy
"
)
this
.
m_setTimeoutIds
.
forEach
(
id
=>
{
if
(
id
)
{
clearTimeout
(
id
)
}
})
this
.
m_setIntervalIds
.
forEach
(
id
=>
{
if
(
id
)
{
clearInterval
(
id
)
}
})
}
maskLayer
=
null
;
initMaskLayer
()
{
const
parentNode
=
this
.
g_cartoon
.
getNodeByPath
(
"
MaskLayer
"
)
...
...
assets/JJ_Game_10/script/JJ_Game_10.js
View file @
26e38797
...
...
@@ -108,6 +108,10 @@ cc.Class({
})
},
onDestroy
()
{
this
.
gameLogic
.
onDestroy
();
},
getData
(
func
)
{
if
(
window
&&
window
.
courseware
)
{
window
.
courseware
.
getData
(
func
,
'
scene
'
);
...
...
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