Commit 6a46d245 authored by Lwd's avatar Lwd

aaaa

parent d1de056a
This diff is collapsed.
...@@ -58,7 +58,7 @@ cc.Class({ ...@@ -58,7 +58,7 @@ cc.Class({
//图片适配 //图片适配
photoScare: function (node) { photoScare: function (node) {
let maxSize = Math.min(90 / node.height, 90 / node.width); let maxSize = Math.min(128 / node.height, 128 / node.width);
if (node.perScale == undefined) { if (node.perScale == undefined) {
node.perScale = node.scaleX; node.perScale = node.scaleX;
} else { } else {
...@@ -111,42 +111,33 @@ cc.Class({ ...@@ -111,42 +111,33 @@ cc.Class({
//如果节点的Id等于当前数据的id的话 //如果节点的Id等于当前数据的id的话
if (this.itemInfo.typeId == g.data_mgr.playId && this.itemInfo.positionId == g.data_mgr.playType) { if (this.itemInfo.typeId == g.data_mgr.playId && this.itemInfo.positionId == g.data_mgr.playType) {
//播放答对音效 //播放答对音效
g.speaker.inst.play_good(); g.speaker.inst.play_good(() => {
this.setBtnState(1); this.setBtnState(1);
//如果是上面答对的话 //如果是上面答对的话
if (this.itemInfo.positionId == 1) { if (this.itemInfo.positionId == 1) {
//执行播放下排的音乐 //执行播放下排的音乐
g.data_mgr.playType = 2; g.data_mgr.playType = 2;
g.game.inst.PlayAudio(); g.game.inst.PlayAudio();
//设置状态 //设置状态
g.game.inst.allLightDark(1, 2); g.game.inst.allLightDark(1, 2);
g.game.inst.allLightDark(2, 0); g.game.inst.allLightDark(2, 0);
//把这个答对的节点保存起来 //把这个答对的节点保存起来
g.data_mgr.itemInfo = this; g.data_mgr.itemInfo = this;
} }
//如果答对的是下排的话 //如果答对的是下排的话
if (this.itemInfo.positionId == 2) { if (this.itemInfo.positionId == 2) {
//连线 //连线
var posStart = g.data_mgr.itemInfo.spt_chick.parent.convertToWorldSpaceAR(g.data_mgr.itemInfo.spt_chick.position); var posStart = g.data_mgr.itemInfo.spt_chick.parent.convertToWorldSpaceAR(g.data_mgr.itemInfo.spt_chick.position);
var posEnd = this.spt_chick.parent.convertToWorldSpaceAR(this.spt_chick.position); var posEnd = this.spt_chick.parent.convertToWorldSpaceAR(this.spt_chick.position);
g.data_mgr.nowNode = this.itemInfo; g.data_mgr.nowNode = this.itemInfo;
g.game.inst.ShowLine(posStart.x - 640, posStart.y - 360, posEnd.x - 640, posEnd.y - 360, () => { g.game.inst.ShowLine(posStart.x - 640, posStart.y - 360, posEnd.x - 640, posEnd.y - 360, () => {
g.data_mgr.itemInfo.setBtnState(3); g.data_mgr.itemInfo.setBtnState(3);
this.setBtnState(3); this.setBtnState(3);
}); });
// //显示弹窗 }
// var Info = g.data_mgr.getResultInfo(this.itemInfo.typeId); });
// g.game.inst.showResult(Info);
//弹窗关闭
// //移除当前播放的音乐
// const index = this.pageArr.indexOf(data);
// if (index !== -1) {
// this.pageArr.splice(index, 1);
// }
}
} }
else { else {
this.spt_error.active = true; this.spt_error.active = true;
......
...@@ -192,10 +192,10 @@ var result = cc.Class({ ...@@ -192,10 +192,10 @@ var result = cc.Class({
return; return;
} }
if (g.data_mgr.temPlayAudio.length < 1) { if (g.data_mgr.temPlayAudio.length < 1) {
if (g.data_mgr.pageId == g.data_mgr.data.contentObj.pageArr.length - 1) { // if (g.data_mgr.pageId == g.data_mgr.data.contentObj.pageArr.length - 1) {
//显示结算撒花 // //显示结算撒花
g.eff_well.inst.showEff(); // g.eff_well.inst.showEff();
} // }
this.End = false; this.End = false;
} else { } else {
//重新随机一组数据 //重新随机一组数据
......
...@@ -56,8 +56,8 @@ var speaker = cc.Class({ ...@@ -56,8 +56,8 @@ var speaker = cc.Class({
g.snd_mgr.playEffect(this.eff_error); g.snd_mgr.playEffect(this.eff_error);
}, },
//答对 //答对
play_good: function () { play_good: function (cb) {
g.snd_mgr.playEffect(this.eff_good); g.snd_mgr.playEffect(this.eff_good, cb);
}, },
//显示弹窗 //显示弹窗
play_showPop: function () { play_showPop: function () {
......
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