Commit c86fc58a authored by 张世斌's avatar 张世斌

1.修复bug

parent 49fc61f9
...@@ -850,7 +850,7 @@ ...@@ -850,7 +850,7 @@
"__id__": 14 "__id__": 14
}, },
"_children": [], "_children": [],
"_active": false, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 16 "__id__": 16
......
import { onHomeworkFinish, RandomInt, playAudio, playDragonBoneAnimation } from "../script/util"; import { onHomeworkFinish, RandomInt, playAudio, playDragonBoneAnimation, asyncDelay } from "../script/util";
import { defaultData } from "../script/defaultData"; import { defaultData } from "../script/defaultData";
cc.Class({ cc.Class({
...@@ -130,6 +130,7 @@ cc.Class({ ...@@ -130,6 +130,7 @@ cc.Class({
this.bindColorButton(item); this.bindColorButton(item);
} }
// this._alligator = this.bindAlligator(this.paint); // this._alligator = this.bindAlligator(this.paint);
// this._alligator2 = this.bindAlligator(this.paint2); // this._alligator2 = this.bindAlligator(this.paint2);
this._alligator = this.paint.getChildByName("alligator");//children[0];//this.bindAlligator(this.paint); this._alligator = this.paint.getChildByName("alligator");//children[0];//this.bindAlligator(this.paint);
...@@ -167,7 +168,9 @@ cc.Class({ ...@@ -167,7 +168,9 @@ cc.Class({
}); });
} }
this.paint.on("click",()=>{ this.paint.on("click",async ()=>{
await asyncDelay(0.5);
cc.log("btnCoolCat");
if (this._can_tap != true) if (this._can_tap != true)
return; return;
this._can_tap=false; this._can_tap=false;
...@@ -398,17 +401,25 @@ cc.Class({ ...@@ -398,17 +401,25 @@ cc.Class({
// }); // });
const btnCoolCat = cc.find('Canvas/bg/bottom_area/BtnCoolCat'); const btnCoolCat = cc.find('Canvas/bg/bottom_area/BtnCoolCat');
btnCoolCat.off("click");
btnCoolCat.on('click', () => { btnCoolCat.on('click', () => {
if(!this._can_tap){
return;
}
this._can_tap=false;
const btn = cc.find('Canvas/bg/btnReplay'); const btn = cc.find('Canvas/bg/btnReplay');
cc.audioEngine.stop();
if (btn.active) { if (btn.active) {
playDragonBoneAnimation(this.coolcat, 'finish', -1); playDragonBoneAnimation(this.coolcat, 'finish', -1);
this.playAudioByUrl(this.data.finishAudio, () => { this.playAudioByUrl(this.data.finishAudio, () => {
playDragonBoneAnimation(this.coolcat, 'normal', -1); playDragonBoneAnimation(this.coolcat, 'normal', -1);
this._can_tap=true;
}); });
} else { } else {
playDragonBoneAnimation(this.coolcat, 'begin', -1); playDragonBoneAnimation(this.coolcat, 'begin', -1);
this.playAudioByUrl(this.data.startAudio, () => { this.playAudioByUrl(this.data.startAudio, () => {
playDragonBoneAnimation(this.coolcat, 'normal', -1); playDragonBoneAnimation(this.coolcat, 'normal', -1);
this._can_tap=true;
}); });
} }
}); });
...@@ -419,6 +430,12 @@ cc.Class({ ...@@ -419,6 +430,12 @@ cc.Class({
this.cleanColor(); this.cleanColor();
this.coolcat.active = true; this.coolcat.active = true;
this.color_selector.active = true;
// this.color_selector.x = this.color_buttons[0].x;
// this.color_selector.y = this.color_buttons[0].y;
this._color = this.getColor("f8ed21");
let spriteFrame=await this.getSpriteFrimeByUrl(this.data.bg); let spriteFrame=await this.getSpriteFrimeByUrl(this.data.bg);
let bg1=this.paint.getChildByName("bg_img"); let bg1=this.paint.getChildByName("bg_img");
// this.log("bg:"+bg1.name); // this.log("bg:"+bg1.name);
...@@ -456,6 +473,7 @@ cc.Class({ ...@@ -456,6 +473,7 @@ cc.Class({
playDragonBoneAnimation(this.coolcat, 'normal', -1); playDragonBoneAnimation(this.coolcat, 'normal', -1);
this._can_tap = true; this._can_tap = true;
}) })
// this.playAudioByName('demo', () => { // this.playAudioByName('demo', () => {
// playDragonBoneAnimation(this.coolcat, 'normal'); // playDragonBoneAnimation(this.coolcat, 'normal');
// this._can_tap = true; // this._can_tap = true;
...@@ -470,7 +488,10 @@ cc.Class({ ...@@ -470,7 +488,10 @@ cc.Class({
btn.active = true; btn.active = true;
btn.canClick = true; btn.canClick = true;
btn.on('click', () => {
console.log('汪汪汪');
cc.director.loadScene('Coloring');
});
const circle = cc.find('Canvas/bg/btnReplay/bg_circle'); const circle = cc.find('Canvas/bg/btnReplay/bg_circle');
cc.tween(circle) cc.tween(circle)
.set({ scale: 0.8, opacity: 255 }) .set({ scale: 0.8, opacity: 255 })
...@@ -658,6 +679,7 @@ cc.Class({ ...@@ -658,6 +679,7 @@ cc.Class({
return; return;
this._can_tap = false; this._can_tap = false;
cc.log("btn teeth");
// clearTimeout(this.paintTimeID); // clearTimeout(this.paintTimeID);
//correct //correct
playDragonBoneAnimation(this.coolcat, 'right', -1); playDragonBoneAnimation(this.coolcat, 'right', -1);
......
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