Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TXZS_G_001
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
TXZS_G_001
Commits
6c49b45a
Commit
6c49b45a
authored
Mar 03, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改随机的泡泡数
parent
8c881d66
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
14 deletions
+27
-14
TXZS_G_001.js
assets/TXZS_G_001/scene/TXZS_G_001.js
+14
-5
GameLogic_TXZS_G_001.js
assets/TXZS_G_001/script/GameLogic_TXZS_G_001.js
+13
-9
No files found.
assets/TXZS_G_001/scene/TXZS_G_001.js
View file @
6c49b45a
...
...
@@ -83,7 +83,12 @@ cc.Class({
getData
((
data
)
=>
{
console
.
log
(
'
data:
'
,
data
);
this
.
data
=
this
.
translateData
(
data
.
rows
)
||
this
.
getDefaultData
();
if
(
data
.
rows
)
{
this
.
data
=
this
.
translateData
(
data
.
rows
)
}
else
{
this
.
data
=
this
.
getDefaultData
();
}
this
.
data
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
));
this
.
preloadItem
()
this
.
preloadItem
(
_
=>
{
...
...
@@ -110,6 +115,10 @@ cc.Class({
})
},
destroyed
()
{
this
.
gameLogic
.
destroyed
&&
this
.
gameLogic
.
destroyed
();
},
getData
(
cb
)
{
let
data
;
...
...
@@ -163,17 +172,17 @@ cc.Class({
}
}
data
.
forEach
((
item
,
index
)
=>
{
const
errItem
=
getErrDataItem
(
data
,
index
,
1
);
const
errItem
=
getErrDataItem
(
data
,
index
,
5
);
const
configItem
=
{
"
correct
"
:
[],
"
incorrect
"
:
[],
"
audio_url1
"
:
item
.
audio_url
"
audio_url1
"
:
item
.
audio_
cn_
url
}
configItem
.
correct
.
push
({
"
type
"
:
"
Text
"
,
"
text
"
:
item
.
text_en
,
"
audio_url
"
:
item
.
audio_url
,
"
audio_url
"
:
item
.
audio_
cn_
url
,
"
image_url
"
:
""
})
...
...
@@ -181,7 +190,7 @@ cc.Class({
configItem
.
incorrect
.
push
({
"
type
"
:
"
Text
"
,
"
text
"
:
eItem
.
text_en
,
"
audio_url
"
:
eItem
.
audio_url
,
"
audio_url
"
:
eItem
.
audio_
cn_
url
,
"
image_url
"
:
""
})
})
...
...
assets/TXZS_G_001/script/GameLogic_TXZS_G_001.js
View file @
6c49b45a
...
...
@@ -16,6 +16,7 @@ export default class GameLogic {
g_audioResList
=
[];
g_animaResList
=
[];
g_properties
=
{};
g_timeoutIds
=
[];
m_bubblesAll
=
[];
m_currentQuestion
=
-
1
;
...
...
@@ -26,6 +27,7 @@ export default class GameLogic {
m_isPlayingAudio
=
false
;
m_sysIntervalId
=
null
;
constructor
(
formData
,
systemOption
)
{
this
.
g_systemOption
=
systemOption
;
this
.
g_imageResList
=
this
.
g_systemOption
.
imageResList
;
...
...
@@ -151,9 +153,9 @@ export default class GameLogic {
let
a
=
btn_lion
.
node
.
getComponent
(
dragonBones
.
ArmatureDisplay
)
a
.
playAnimation
(
aniName
,
1
);
setTimeout
(()
=>
{
this
.
g_timeoutIds
.
push
(
setTimeout
(()
=>
{
a
.
playAnimation
(
aniName
,
-
1
);
},
3200
)
;
},
3200
)
)
}
...
...
@@ -569,10 +571,10 @@ export default class GameLogic {
this
.
m_bubblesAll
=
this
.
save
;
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
this
.
g_timeoutIds
.
push
(
setTimeout
(()
=>
{
resolve
();
this
.
enableClick
(
"
DestroyBubbles
"
)
},
1100
);
},
1100
)
)
;
})
}
...
...
@@ -614,12 +616,12 @@ export default class GameLogic {
bubble
.
move
.
vX
=
vArr
[
count
%
4
].
vX
bubble
.
move
.
vY
=
vArr
[
count
%
4
].
vY
count
++
;
setTimeout
(()
=>
{
this
.
g_timeoutIds
.
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
)
}
...
...
@@ -683,9 +685,9 @@ export default class GameLogic {
asyncDelay
(
time
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
this
.
g_timeoutIds
.
push
(
setTimeout
(()
=>
{
resolve
();
},
time
*
1000
);
},
time
*
1000
)
)
;
})
}
...
...
@@ -744,7 +746,9 @@ export default class GameLogic {
});
}
destroyed
()
{
console
.
log
(
"
DES
"
)
}
...
...
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