Commit 2fea06f1 authored by limingzhe's avatar limingzhe

fix: debug

parent 1555d306
......@@ -213,12 +213,12 @@ cc.Class({
this.initTopPart();
this.initCurQues();
this.showWord();
this.showPic();
this.initColorPen();
// this.createLetterPage(this._status.currentLetter);
// // this.initTitle();
......@@ -236,6 +236,11 @@ cc.Class({
},
startShow() {
this.showWord();
this.showPic();
},
initCurQues() {
this.curQues = this.wordArr[this.wordArrIndex];
if (!this.curQues) {
......@@ -709,6 +714,7 @@ cc.Class({
if (!this.data.npcAudio) {
this.img_npc_voice.active = false;
this.startShow();
} else {
......@@ -716,7 +722,9 @@ cc.Class({
this.npcVoiceClick();
})
this.npcVoiceClick();
this.npcVoiceClick(() => {
this.startShow();
});
}
......@@ -726,7 +734,7 @@ cc.Class({
},
npcVoiceClick() {
npcVoiceClick(cb = null) {
const picNode = cc.find('p1', this.img_npc_voice);
const animNode = cc.find("p2", this.img_npc_voice);
......@@ -741,6 +749,7 @@ cc.Class({
return;
}
cb && cb();
// picNode.active = true;
// animNode.active = false;
// this.maskNode.active = false;
......@@ -1238,7 +1247,8 @@ cc.Class({
onSharkTouchEnd(event) {
const shark = event.target;
this.checkOnEndPoint(shark);
// this.checkOnEndPoint(shark);
this.checkNoPoint(shark);
this.isCheckPlayMoveAudio = false;
this.oldMoveLocaltion = false;
......@@ -1246,14 +1256,112 @@ cc.Class({
// const shark = event.target;
shark.lastPos = null;
shark.startPos = null;
this.curMoveLocation = null;
// this._status._currentPointIdx = 0;
// this.updateCurrentGraph(true);
// this.moveSharkBack(event.target);
// this.showArrows();
},
checkNoPoint(shark) {
if (!this.curMoveLocation) {
return;
}
for (let i=0; i<this._arrowList.length; i++) {
if (this._arrowList[i].active) {
return;
}
}
console.log(" in checkOnEndPoint")
const pos = cc.v2(shark.x, shark.y);
const letter = this._status.currentLetter;
const penIdx = this._status._currentPenIdx;
const pointIdx = this._status._currentPointIdx;
if (!letterData[letter][penIdx]) {
return;
}
this._status._currentPointIdx++;
if (this._status._currentPointIdx >= letterData[letter][penIdx].length - 1) {
this.changeCurDrawNode();
this._status._currentPointIdx = 0;
this._status._currentPenIdx++;
shark.lastPos = null;
shark.startPos = null;
// this.showFlower(shark);
if (this._status._currentPenIdx < letterData[letter].length) {
this.removeStar();
this.createArrows();
this.createStar();
playAudio(this.line_end_Clip);
} else {
this.removeStar();
this.showOver(shark);
this.playLetterAudio(() => {
this.showGold(() => {
if (this.isDestroy) {
return;
}
this.changeNewLetter();
});
})
}
this.curMoveLocation = null;
this.updateCurrentPointIdx(shark);
this._status._currentPointIdx = 0;
this.moveSharkBack(shark);
}
this.updateArrows(shark);
},
checkOnEndPoint(shark) {
if (!this.curMoveLocation) {
return;
}
console.log(" in checkOnEndPoint")
const pos = cc.v2(shark.x, shark.y);
const letter = this._status.currentLetter;
......@@ -1302,10 +1410,14 @@ cc.Class({
this.createStar();
playAudio(this.line_end_Clip);
} else {
this.oneLetterEnd(shark);
}
this.curMoveLocation = null;
// this.updateCurrentGraph(true);
......@@ -1402,6 +1514,7 @@ cc.Class({
}
// this.updateCurrentGraph(true);
this.curMoveLocation = null;
this.updateCurrentPointIdx(shark);
......
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