Commit c19c502b authored by 李维's avatar 李维

Bug fix

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