Commit 2fea06f1 authored by limingzhe's avatar limingzhe

fix: debug

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