Commit c19c502b authored by 李维's avatar 李维

Bug fix

parent c0d3ad25
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
"array": [ "array": [
0, 0,
0, 0,
469.5806533322543, 479.981048400591,
0, 0,
0, 0,
0, 0,
...@@ -5224,7 +5224,7 @@ ...@@ -5224,7 +5224,7 @@
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"showInEditor": false, "showInEditor": false,
"_id": "a6cMZKz9VPqr9hCh7APcsa" "_id": "00gNvkrSNPEonUOndHL7KH"
}, },
{ {
"__type__": "cc.Label", "__type__": "cc.Label",
...@@ -5260,7 +5260,7 @@ ...@@ -5260,7 +5260,7 @@
"_N$fontFamily": "Arial", "_N$fontFamily": "Arial",
"_N$overflow": 0, "_N$overflow": 0,
"_N$cacheMode": 0, "_N$cacheMode": 0,
"_id": "68eDLZExhJ3rKi3Wkk17Vi" "_id": "9coAEuxxVHQIalk+e+xFDk"
}, },
{ {
"__type__": "cc.PrivateNode", "__type__": "cc.PrivateNode",
...@@ -5323,7 +5323,7 @@ ...@@ -5323,7 +5323,7 @@
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"showInEditor": false, "showInEditor": false,
"_id": "e07ojz2NtIYoZeBppxhZ7a" "_id": "9btbLEqFNIiqeVSFF0sswR"
}, },
{ {
"__type__": "cc.Label", "__type__": "cc.Label",
...@@ -5359,7 +5359,7 @@ ...@@ -5359,7 +5359,7 @@
"_N$fontFamily": "Arial", "_N$fontFamily": "Arial",
"_N$overflow": 0, "_N$overflow": 0,
"_N$cacheMode": 0, "_N$cacheMode": 0,
"_id": "67LYV0D85IP6672RSADLKn" "_id": "c11yiQHb9OmZ5JU30f5Xnw"
}, },
{ {
"__type__": "cc.RichText", "__type__": "cc.RichText",
......
...@@ -284,6 +284,7 @@ cc.Class({ ...@@ -284,6 +284,7 @@ cc.Class({
this._enableRestart = true; this._enableRestart = true;
this.doneFlag = [false, false]; this.doneFlag = [false, false];
this.currentCase = 0; this.currentCase = 0;
this._disableButtons = false;
}, },
start() { start() {
...@@ -338,6 +339,9 @@ cc.Class({ ...@@ -338,6 +339,9 @@ cc.Class({
repositionButton() { repositionButton() {
const bottomButtons = cc.find('Canvas/bottomButtons'); const bottomButtons = cc.find('Canvas/bottomButtons');
bottomButtons.y = -cc.winSize.height / 2 + 40 bottomButtons.y = -cc.winSize.height / 2 + 40
const buttonsSwitch = cc.find('Canvas/buttons');
buttonsSwitch.y = -cc.winSize.height / 2 + 75
}, },
initListeners() { initListeners() {
...@@ -352,7 +356,6 @@ cc.Class({ ...@@ -352,7 +356,6 @@ cc.Class({
const switch_b2s = cc.find('Canvas/buttons/switch_b2s'); const switch_b2s = cc.find('Canvas/buttons/switch_b2s');
const switch_s2b = cc.find('Canvas/buttons/switch_s2b'); const switch_s2b = cc.find('Canvas/buttons/switch_s2b');
console.log(switch_b2s, switch_s2b)
this.repositionButton(); this.repositionButton();
let that = this let that = this
...@@ -361,13 +364,12 @@ cc.Class({ ...@@ -361,13 +364,12 @@ cc.Class({
}); });
btn_restart.on('click', async () => { btn_restart.on('click', async () => {
if(!this._enableRestart) { if(!this._enableRestart || this._disableButtons) {
return; return;
} }
this._enableRestart = false; this._enableRestart = false;
this.playEffect('按钮'); this.playEffect('按钮');
await jelly(btn_restart); await jelly(btn_restart);
btn_restart.active = false;
this.pageFlyOut(); this.pageFlyOut();
// this.restartGame(); // this.restartGame();
if(this.sharkNode) { if(this.sharkNode) {
...@@ -376,7 +378,6 @@ cc.Class({ ...@@ -376,7 +378,6 @@ cc.Class({
} }
this.createLetterPage(this.letter); this.createLetterPage(this.letter);
setTimeout(() => { setTimeout(() => {
btn_restart.active = true;
this._enableRestart = true;; this._enableRestart = true;;
}, 1000); }, 1000);
// this.loadNextLetter() // this.loadNextLetter()
...@@ -399,7 +400,9 @@ cc.Class({ ...@@ -399,7 +400,9 @@ cc.Class({
}); });
switch_b2s.on('click', async () => { switch_b2s.on('click', async () => {
console.log("switch_b2s click"); if(this._disableButtons) {
return;
}
this.playEffect('按钮'); this.playEffect('按钮');
await jelly(switch_b2s); await jelly(switch_b2s);
// this.playEffect(`letter${this.letter.toUpperCase()}`); // this.playEffect(`letter${this.letter.toUpperCase()}`);
...@@ -422,7 +425,9 @@ cc.Class({ ...@@ -422,7 +425,9 @@ cc.Class({
.start(); .start();
}); });
switch_s2b.on('click', async () => { switch_s2b.on('click', async () => {
console.log("switch_s2b click"); if(this._disableButtons) {
return;
}
this.playEffect('按钮'); this.playEffect('按钮');
await jelly(switch_s2b); await jelly(switch_s2b);
// this.playEffect(`letter${this.letter.toUpperCase()}`); // this.playEffect(`letter${this.letter.toUpperCase()}`);
...@@ -477,7 +482,9 @@ cc.Class({ ...@@ -477,7 +482,9 @@ cc.Class({
btnNext.active = false; btnNext.active = false;
btnBefore.on('click', async () => { btnBefore.on('click', async () => {
console.log("btnBefore click") if(this._disableButtons) {
return;
}
if (btnClicked) { if (btnClicked) {
return; return;
} }
...@@ -501,7 +508,9 @@ cc.Class({ ...@@ -501,7 +508,9 @@ cc.Class({
}); });
btnNext.on('click', async () => { btnNext.on('click', async () => {
console.log("btnNext click") if(this._disableButtons) {
return;
}
if (btnClicked) { if (btnClicked) {
return; return;
} }
...@@ -1051,14 +1060,7 @@ cc.Class({ ...@@ -1051,14 +1060,7 @@ cc.Class({
}, },
async showOver() { async showOver() {
let btn_restart = cc.find('Canvas/bottomButtons/btn_restart'); this.disableButtons();
btn_restart.active = false;
// btn_restart.scaleX = 0;
// btn_restart.scaleY = 0;
setTimeout(() => {
// cc.tween(btn_restart).to(0.2, {scaleX: 1, scaleY: 1}).start();
btn_restart.active = true;
}, 5000);
this.hideShark(); this.hideShark();
// this.playEffect('放大'); // this.playEffect('放大');
...@@ -1176,7 +1178,31 @@ cc.Class({ ...@@ -1176,7 +1178,31 @@ cc.Class({
return posList; return posList;
}, },
disableButtons(time) {
time = time?time:5
this._disableButtons = true;
let btn_restart = cc.find('Canvas/bottomButtons/btn_restart');
let btnBefore = cc.find('Canvas/bottomButtons/BtnBefore');
let btnNext = cc.find('Canvas/bottomButtons/BtnNext');
let switch_b2s = cc.find('Canvas/buttons/switch_b2s');
let switch_s2b = cc.find('Canvas/buttons/switch_s2b');
btn_restart.opacity = 125;
btnBefore.opacity = 125;
btnNext.opacity = 125;
switch_b2s.opacity = 125;
switch_s2b.opacity = 125;
setTimeout(() => {
this._disableButtons = false;
btn_restart.opacity = 255;
btnBefore.opacity = 255;
btnNext.opacity = 255;
switch_b2s.opacity = 255;
switch_s2b.opacity = 255;
}, time * 1000);
},
pageFlyOut() { pageFlyOut() {
this.disableButtons(1)
const letterNodeBase = cc.find(`Canvas/letterNodeBase`); const letterNodeBase = cc.find(`Canvas/letterNodeBase`);
letterNodeBase.name = 'letterNodeBase0'; letterNodeBase.name = 'letterNodeBase0';
letterNodeBase.zIndex = 10; letterNodeBase.zIndex = 10;
......
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