Commit 676f5b9b authored by WangFan's avatar WangFan

1、透明度调整 2、添加正确、错误音效 3、自动播放音频

parent ba4cbdee
......@@ -563,7 +563,7 @@
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_opacity": 125,
"_color": {
"__type__": "cc.Color",
"r": 255,
......
......@@ -82,6 +82,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
private layer_record: cc.Node;
private layer_word: cc.Node;
private layers: Array<cc.Node>;
private res_audio: cc.Node;
initView() {
this.layer_record = pg.view.find(this, 'layer_record')
this.layer_word = pg.view.find(this, 'layer_word')
......@@ -98,6 +99,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.lower_word = pg.view.find(this.layer_word, "lower_word");
this.res_audio = pg.view.find(this, "res/audio")
this.showWord()
}
......@@ -112,7 +115,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 校验是否正确
checkIsRight() {
console.log(this.curIndex + 1 < SceneComponent.Word_List_Len);
if ((this.curIndex + 1) < SceneComponent.Word_List_Len) {
this.curIndex++
this.showWord()
......@@ -125,9 +127,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
private wordBgList: Array<cc.Node>;
private wordList: Array<cc.Node>;
private get CurrentWord(): any {
// 默认播放当前音频
let audio_url = this.wordDataList[this.curIndex].audio
if (audio_url) pg.audio.playAudioByUrl(audio_url)
return this.wordDataList[this.curIndex];
}
playCurrentVideo() {
}
nextWord() {
let success = true;
for (let idx in this.successGroupIds) {
......@@ -420,6 +427,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
if ((groupId || groupId == 0) && node.data[0].data.group == groupId) {
console.log(groupId)
// 正确了 需要处理效果
pg.audio.playLocalAudio(pg.view.find(this.res_audio, "right"))
let nodes = node.data;
let targets = this.getWordBgByGroup(groupId);
nodes.forEach(item => {
......@@ -433,6 +441,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
node.off(cc.Node.EventType.TOUCH_END, this.onTouchEnd, this);
this.nextWord();
} else {
pg.audio.playLocalAudio(pg.view.find(this.res_audio, "fail"))
let subX = node.x - node.orgPos.x;
let subY = node.y - node.orgPos.y;
node.x -= subX;
......
......@@ -3,7 +3,7 @@ export const defaultData = {
{
"questionAudio": "", "duration": 120,
"type": "img", "image": "http://staging-teach.cdn.ireadabc.com/710feaeb43f2b610cfe6946de05c3567.png",
"audio": "", "text": "", "right": false,
"audio": "http://staging-teach.cdn.ireadabc.com/48c425442c9d555e7f1226b81d4b8fa6_l.mp3", "text": "", "right": false,
"letterList": [{ "text": "c" }, { "text": "a" }, { "text": "p" }, { "text": "able" }]
},
{
......
{
"ver": "1.1.2",
"uuid": "6cb034d1-7891-4c4f-bc13-f0cddeac01ff",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "8720b6ba-1b31-4e59-9cbe-c6ab93b53e94",
"downloadMode": 0,
"duration": 0.835918,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "8b764508-39fd-4eb9-98f5-7df481685fa5",
"downloadMode": 0,
"duration": 2.220417,
"subMetas": {}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment