Commit 477c70c0 authored by Tt's avatar Tt

修改尾部红字 及 音频播放

parent 522a5997
This diff is collapsed.
{ {
"ver": "1.2.8", "ver": "1.2.9",
"uuid": "d0944338-a5a6-44e9-bd37-eb928c715bd4", "uuid": "d0944338-a5a6-44e9-bd37-eb928c715bd4",
"asyncLoadAssets": false, "asyncLoadAssets": false,
"autoReleaseAssets": true, "autoReleaseAssets": true,
......
...@@ -641,8 +641,51 @@ cc.Class({ ...@@ -641,8 +641,51 @@ cc.Class({
wordAni(item, content) { wordAni(item, content) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (this._stageData.isLast) {
item.active = true;
let itemfirst = pg.view.find(item, "last");
let itemOther = pg.view.find(item, "first");
itemfirst.active = true;
itemOther.active = false;
//动态居中算法。
//锚点在中间,左右延长,第一个字不去显示
let contentArr = content.split("");
let s0 = contentArr.pop();
let s1 = contentArr.join("");
//首字母变大
let count = 80;
let max = 120;
let str1 = `<size=${count}><color=#0000>${s1}</color></size>` + `<size=${max}><color=#ffffff>${s0}</color></size>`
let strfirst1 = `<size=${max}><color=#fc4a4a>${s0}</color></size>`;
item.getComponent(cc.RichText).string = str1;
itemfirst.y = 17;
itemfirst.getComponent(cc.RichText).string = strfirst1;
this._timeoutIds.push(setTimeout(() => {
let times = 20;
let time = 0;
let inter = setInterval(() => {
time++;
let nowCount = count + (max - count) * (time / times);
if (nowCount >= 120) {
nowCount = 120;
clearInterval(inter);
}
let str2 = `<size=${nowCount}><color=#0000>${s1}</color></size>` + `<size=${max}><color=#ffffff>${s0}</color></size>`
itemfirst.y = 0;
item.getComponent(cc.RichText).string = str2;
}, 30);
this._intervalIds.push(inter);
setTimeout(() => {
resolve('');
}, 1200);
}, 4100));
} else {
item.active = true; item.active = true;
let itemfirst = pg.view.find(item, "first"); let itemfirst = pg.view.find(item, "first");
let itemOther = pg.view.find(item, "last");
itemfirst.active = true;
itemOther.active = false;
//动态居中算法。 //动态居中算法。
//锚点在中间,左右延长,第一个字不去显示 //锚点在中间,左右延长,第一个字不去显示
let contentArr = content.split(""); let contentArr = content.split("");
...@@ -676,7 +719,9 @@ cc.Class({ ...@@ -676,7 +719,9 @@ cc.Class({
resolve(''); resolve('');
}, 1200); }, 1200);
}, 4100)); }, 4100));
}
}); });
}, },
//按钮触发,使用的方法 //按钮触发,使用的方法
...@@ -770,6 +815,15 @@ cc.Class({ ...@@ -770,6 +815,15 @@ cc.Class({
this.playWordAni(true); this.playWordAni(true);
}, },
onTouchCat() { onTouchCat() {
if (GameManager.getIns().getState() >= 5) {
if (this._playing) return;
this._playing = true;
this.setMaoAni("begin");
pg.audio.playAudioByUrl(this._cat.finish).then(() => {
this.setMaoAni("normal");
this._playing = false;
})
} else {
if (this._playing) return; if (this._playing) return;
this._playing = true; this._playing = true;
this.setMaoAni("begin"); this.setMaoAni("begin");
...@@ -777,6 +831,7 @@ cc.Class({ ...@@ -777,6 +831,7 @@ cc.Class({
this.setMaoAni("normal"); this.setMaoAni("normal");
this._playing = false; this._playing = false;
}) })
}
}, },
nextStage() { nextStage() {
......
...@@ -35,6 +35,7 @@ class GameManager { ...@@ -35,6 +35,7 @@ class GameManager {
obj.word = ar.title; obj.word = ar.title;
obj.sound = ar.wordAudio; obj.sound = ar.wordAudio;
obj.img = ar.bgImg; obj.img = ar.bgImg;
obj.isLast = ar.isLast || false;
obj.cartoonSke = ar.imgAni.ske.url; obj.cartoonSke = ar.imgAni.ske.url;
obj.cartoonTex = ar.imgAni.tex.url; obj.cartoonTex = ar.imgAni.tex.url;
obj.cartoonPng = ar.imgAni.png.url; obj.cartoonPng = ar.imgAni.png.url;
......
...@@ -13,10 +13,13 @@ export const defaultData = { ...@@ -13,10 +13,13 @@ export const defaultData = {
}, },
"list": [ "list": [
{ {
isLast: true,
"title": "appleappl", "bgImg": "http://staging-teach.cdn.ireadabc.com/97e19da9309e4e5aafca5ea2e9db8f46.png", "wordAudio": "http://staging-teach.cdn.ireadabc.com/ab3538f7d4d57ac1abd740bd32f06b2d.mp3", "imgAni": { "ske": { "url": "http://staging-teach.cdn.ireadabc.com/c81816bbb714b22c57267ac5150ee1fe.json", "name": "apple_ske.json" }, "tex": { "url": "http://staging-teach.cdn.ireadabc.com/6088eec0273bc0488d5f66dfb63c1003.json", "name": "apple_tex.json" }, "png": { "url": "http://staging-teach.cdn.ireadabc.com/a51151d68bd74d430e2e586d86c6ddd3.png", "name": "apple_tex.png" } } "title": "appleappl", "bgImg": "http://staging-teach.cdn.ireadabc.com/97e19da9309e4e5aafca5ea2e9db8f46.png", "wordAudio": "http://staging-teach.cdn.ireadabc.com/ab3538f7d4d57ac1abd740bd32f06b2d.mp3", "imgAni": { "ske": { "url": "http://staging-teach.cdn.ireadabc.com/c81816bbb714b22c57267ac5150ee1fe.json", "name": "apple_ske.json" }, "tex": { "url": "http://staging-teach.cdn.ireadabc.com/6088eec0273bc0488d5f66dfb63c1003.json", "name": "apple_tex.json" }, "png": { "url": "http://staging-teach.cdn.ireadabc.com/a51151d68bd74d430e2e586d86c6ddd3.png", "name": "apple_tex.png" } }
}, { }, {
isLast: true,
"title": "ant", "bgImg": "http://staging-teach.cdn.ireadabc.com/0600790c4336c3839d90756aca5da45e.png", "wordAudio": "http://staging-teach.cdn.ireadabc.com/ab3538f7d4d57ac1abd740bd32f06b2d.mp3", "imgAni": { "ske": { "url": "http://staging-teach.cdn.ireadabc.com/dd4ede22a761f1f8ec261c93a5306f5c.json", "name": "ant_ske.json" }, "tex": { "url": "http://staging-teach.cdn.ireadabc.com/56078bcdcc7116843a56ecc4c23d3665.json", "name": "ant_tex.json" }, "png": { "url": "http://staging-teach.cdn.ireadabc.com/1a0c95cab05487b003a8dec9dd151ba4.png", "name": "ant_tex.png" } } "title": "ant", "bgImg": "http://staging-teach.cdn.ireadabc.com/0600790c4336c3839d90756aca5da45e.png", "wordAudio": "http://staging-teach.cdn.ireadabc.com/ab3538f7d4d57ac1abd740bd32f06b2d.mp3", "imgAni": { "ske": { "url": "http://staging-teach.cdn.ireadabc.com/dd4ede22a761f1f8ec261c93a5306f5c.json", "name": "ant_ske.json" }, "tex": { "url": "http://staging-teach.cdn.ireadabc.com/56078bcdcc7116843a56ecc4c23d3665.json", "name": "ant_tex.json" }, "png": { "url": "http://staging-teach.cdn.ireadabc.com/1a0c95cab05487b003a8dec9dd151ba4.png", "name": "ant_tex.png" } }
}, { }, {
isLast: true,
"title": "allaign", "bgImg": "http://staging-teach.cdn.ireadabc.com/97e19da9309e4e5aafca5ea2e9db8f46.png", "wordAudio": "http://staging-teach.cdn.ireadabc.com/ab3538f7d4d57ac1abd740bd32f06b2d.mp3", "imgAni": { "ske": { "url": "http://staging-teach.cdn.ireadabc.com/cf0fd816076652f64cc992c084248a80.json", "name": "alligator_ske.json" }, "tex": { "url": "http://staging-teach.cdn.ireadabc.com/5ece588b347d8fbe05eba19a40c985f0.json", "name": "alligator_tex.json" }, "png": { "url": "http://staging-teach.cdn.ireadabc.com/a84eff5545eca41f3e997ea8a53ac66f.png", "name": "alligator_tex.png" } } "title": "allaign", "bgImg": "http://staging-teach.cdn.ireadabc.com/97e19da9309e4e5aafca5ea2e9db8f46.png", "wordAudio": "http://staging-teach.cdn.ireadabc.com/ab3538f7d4d57ac1abd740bd32f06b2d.mp3", "imgAni": { "ske": { "url": "http://staging-teach.cdn.ireadabc.com/cf0fd816076652f64cc992c084248a80.json", "name": "alligator_ske.json" }, "tex": { "url": "http://staging-teach.cdn.ireadabc.com/5ece588b347d8fbe05eba19a40c985f0.json", "name": "alligator_tex.json" }, "png": { "url": "http://staging-teach.cdn.ireadabc.com/a84eff5545eca41f3e997ea8a53ac66f.png", "name": "alligator_tex.png" } }
}] }]
} }
......
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