Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ET-18
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
ET-18
Commits
2acf037e
Commit
2acf037e
authored
Feb 24, 2021
by
asdf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
7754d0e4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
117 additions
and
26 deletions
+117
-26
DefaultData.js
play/assets/tmpGame/script/DefaultData.js
+78
-1
ItemPart.js
play/assets/tmpGame/script/ItemPart.js
+3
-0
ItemWord.js
play/assets/tmpGame/script/ItemWord.js
+3
-0
Scene.js
play/assets/tmpGame/script/Scene.js
+33
-25
No files found.
play/assets/tmpGame/script/DefaultData.js
View file @
2acf037e
export
const
DefaultData
=
{
"
questionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/2c383c1fce3d89070430342b36469a9c.mp3
"
,
"
questionText
"
:
"
123123
"
,
"
questionList
"
:[{
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/b0c23eb327ec13212d09516a1a8a49ec.mp3
"
,
"
optionList
"
:[{
"
text
"
:
"
a
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/0a78ca4f93c66c026d1e5319baffae6e.mp3
"
},{
"
text
"
:
"
p
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/d4a2488ca37b24c40012132d95484459.mp3
"
},{
"
text
"
:
"
p
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/7934cdcec68eabe639020bad5420d7f8.mp3
"
}],
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/4ac874d2be7a6553af954f8fb9270d29.png
"
},{
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/b0c23eb327ec13212d09516a1a8a49ec.mp3
"
,
"
optionList
"
:[{
"
text
"
:
"
a
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/0a78ca4f93c66c026d1e5319baffae6e.mp3
"
},{
"
text
"
:
"
p
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/d4a2488ca37b24c40012132d95484459.mp3
"
},{
"
text
"
:
"
c
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/7934cdcec68eabe639020bad5420d7f8.mp3
"
}],
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/43aa0e7a55b4b2814c86ad6c835297bf.png
"
}]}
\ No newline at end of file
export
const
DefaultData
=
{
"
questionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/2c383c1fce3d89070430342b36469a9c.mp3
"
,
"
questionText
"
:
"
123123
"
,
"
questionList
"
:[
{
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/b0c23eb327ec13212d09516a1a8a49ec.mp3
"
,
"
optionList
"
:[
{
"
text
"
:
"
a
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/0a78ca4f93c66c026d1e5319baffae6e.mp3
"
},
{
"
text
"
:
"
p
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/d4a2488ca37b24c40012132d95484459.mp3
"
},
{
"
text
"
:
"
p
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/7934cdcec68eabe639020bad5420d7f8.mp3
"
}
],
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/4ac874d2be7a6553af954f8fb9270d29.png
"
},
{
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/b0c23eb327ec13212d09516a1a8a49ec.mp3
"
,
"
optionList
"
:[
{
"
text
"
:
"
a
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/0a78ca4f93c66c026d1e5319baffae6e.mp3
"
},
{
"
text
"
:
"
p
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/d4a2488ca37b24c40012132d95484459.mp3
"
},
{
"
text
"
:
"
c
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/7934cdcec68eabe639020bad5420d7f8.mp3
"
}
],
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/43aa0e7a55b4b2814c86ad6c835297bf.png
"
},
{
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/b0c23eb327ec13212d09516a1a8a49ec.mp3
"
,
"
optionList
"
:[
{
"
text
"
:
"
a
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/0a78ca4f93c66c026d1e5319baffae6e.mp3
"
},
{
"
text
"
:
"
p
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/d4a2488ca37b24c40012132d95484459.mp3
"
},
{
"
text
"
:
"
c
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/7934cdcec68eabe639020bad5420d7f8.mp3
"
}
],
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/43aa0e7a55b4b2814c86ad6c835297bf.png
"
},
{
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/b0c23eb327ec13212d09516a1a8a49ec.mp3
"
,
"
optionList
"
:[
{
"
text
"
:
"
a
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/0a78ca4f93c66c026d1e5319baffae6e.mp3
"
},
{
"
text
"
:
"
p
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/d4a2488ca37b24c40012132d95484459.mp3
"
},
{
"
text
"
:
"
c
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/7934cdcec68eabe639020bad5420d7f8.mp3
"
}
],
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/43aa0e7a55b4b2814c86ad6c835297bf.png
"
}
]
}
\ No newline at end of file
play/assets/tmpGame/script/ItemPart.js
View file @
2acf037e
...
...
@@ -203,6 +203,9 @@ cc.Class({
},
playAudio
()
{
if
(
GameData
.
audioCount
!==
0
){
return
;
}
GameData
.
audioCount
++
;
let
url
=
this
.
data
.
optionAudio
;
cc
.
assetManager
.
loadRemote
(
url
,
null
,
(
err
,
clip
)
=>
{
...
...
play/assets/tmpGame/script/ItemWord.js
View file @
2acf037e
...
...
@@ -26,6 +26,9 @@ cc.Class({
},
playAudio
(){
if
(
GameData
.
audioCount
!==
0
){
return
;
}
GameData
.
audioCount
++
;
let
url
=
this
.
data
.
audio
;
cc
.
assetManager
.
loadRemote
(
url
,
null
,
(
err
,
clip
)
=>
{
...
...
play/assets/tmpGame/script/Scene.js
View file @
2acf037e
...
...
@@ -115,6 +115,14 @@ cc.Class({
if
(
this
.
data
.
questionList
.
length
===
0
)
{
return
;
}
this
.
initBoot
();
this
.
initData
();
this
.
updateBtnStatus
();
this
.
startGame
();
},
initBoot
(){
GameData
.
questionIndex
=
0
;
this
.
loadCenterImage
();
this
.
questionList
=
[];
...
...
@@ -122,9 +130,24 @@ cc.Class({
this
.
questionList
.
push
(
i
);
}
this
.
initData
();
this
.
updateBtnStatus
();
this
.
startGame
();
this
.
nodeDict
.
nodBgTitle
.
on
(
'
touchstart
'
,
()
=>
{
GameData
.
audioCount
++
;
let
url
=
this
.
data
.
questionAudio
;
// url = 'http://127.0.0.1/iamflying.mp3';
cc
.
assetManager
.
loadRemote
(
url
,
null
,
(
err
,
clip
)
=>
{
if
(
err
)
{
console
.
log
(
err
)
return
;
}
let
id
=
cc
.
audioEngine
.
play
(
clip
,
false
,
1
);
cc
.
audioEngine
.
setFinishCallback
(
id
,
()
=>
{
if
(
!
cc
.
isValid
(
this
))
{
return
;
}
GameData
.
audioCount
--
;
})
});
});
},
loadCenterImage
()
{
...
...
@@ -153,7 +176,6 @@ cc.Class({
let
manager
=
cc
.
director
.
getCollisionManager
();
manager
.
enabled
=
true
;
this
.
nodeDict
.
layerParts
.
destroyAllChildren
();
console
.
log
(
this
.
nodeDict
.
layerParts
)
this
.
nodeDict
.
layerParts
.
getComponent
(
cc
.
Layout
).
enabled
=
true
;
this
.
audioSpfIndex
=
0
;
GameData
.
audioCount
=
0
;
...
...
@@ -172,24 +194,6 @@ cc.Class({
if
(
this
.
nodeDict
.
labTitle
.
width
>
290
)
{
this
.
nodeDict
.
labTitle
.
scale
=
290
/
this
.
nodeDict
.
labTitle
.
width
}
this
.
nodeDict
.
nodBgTitle
.
on
(
'
touchstart
'
,
()
=>
{
GameData
.
audioCount
++
;
let
url
=
this
.
data
.
questionAudio
;
// url = 'http://127.0.0.1/iamflying.mp3';
cc
.
assetManager
.
loadRemote
(
url
,
null
,
(
err
,
clip
)
=>
{
if
(
err
)
{
console
.
log
(
err
)
return
;
}
let
id
=
cc
.
audioEngine
.
play
(
clip
,
false
,
1
);
cc
.
audioEngine
.
setFinishCallback
(
id
,
()
=>
{
if
(
!
cc
.
isValid
(
this
))
{
return
;
}
GameData
.
audioCount
--
;
})
});
});
},
initOptions
()
{
...
...
@@ -274,27 +278,28 @@ cc.Class({
resetDate
()
{
this
.
nodeDict
.
layerDone
.
active
=
false
;
cc
.
audioEngine
.
stopAll
();
GameData
.
audioCount
=
0
;
this
.
initData
();
this
.
updateBtnStatus
();
this
.
loadCenterImage
();
},
onTurnLast
()
{
if
(
GameData
.
audioCount
!=
0
)
{
return
;
//
return;
}
GameData
.
questionIndex
--
;
this
.
resetDate
();
},
onReplay
()
{
if
(
GameData
.
audioCount
!=
0
)
{
return
;
//
return;
}
this
.
resetDate
();
this
.
playAudioReplay
();
},
onTurnNext
()
{
if
(
GameData
.
audioCount
!=
0
)
{
return
;
//
return;
}
GameData
.
questionIndex
++
;
this
.
resetDate
();
...
...
@@ -346,6 +351,9 @@ cc.Class({
},
playAudio
(
cb
)
{
if
(
GameData
.
audioCount
!==
0
){
return
;
}
GameData
.
audioCount
++
;
let
url
=
this
.
data
.
questionList
[
GameData
.
questionIndex
].
audio
;
// url = 'http://127.0.0.1/iamflying.mp3';
...
...
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