Commit 6a46d245 authored by Lwd's avatar Lwd

aaaa

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