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

1.修复bug

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