diff --git a/src/views/Block.ts b/src/views/Block.ts index 90bd08e..9b8ed65 100644 --- a/src/views/Block.ts +++ b/src/views/Block.ts @@ -66,11 +66,14 @@ export class Block extends Laya.Script { this.owner.graphics.clear() this.owner.graphics.drawRect(0, 0, blockSize, blockSize, color) if (animated) { - Laya.Tween.to(this.owner, {alpha:alpha}, 500, Laya.Ease.elasticOut, Laya.Handler.create(this, () => { + this.owner.alpha = 0 + Laya.Tween.to(this.owner, {alpha:alpha}, 100, Laya.Ease.linearIn) + Laya.Tween.to(this.owner, {alpha:0}, 150, Laya.Ease.linearIn, null, 100) + Laya.Tween.to(this.owner, {alpha:alpha}, 100, Laya.Ease.linearIn, Laya.Handler.create(this, () => { this.owner.graphics.clear() this.owner.graphics.drawRect(0, 0, blockSize, blockSize, completedColor) this.owner.alpha = completedAlpha - })) + }), 250) } else { this.owner.alpha = alpha @@ -79,20 +82,18 @@ export class Block extends Laya.Script { public setFadeAnimation(): void { var color = this.label_show.color - var flag = true - Laya.timer.loop(200, this, ()=>{ - flag = !flag - if (flag) { + Laya.timer.once(200, this, ()=>{ + this.label_show.color = "#ff0000" + Laya.timer.once(100, this, ()=>{ this.label_show.color = color - } - else { - this.label_show.color = "#ff0000" - } + Laya.timer.once(200, this, ()=>{ + this.label_show.color = "#ff0000" + Laya.timer.once(100, this, ()=>{ + this.label_show.color = color + }) + }) + }) }) - Laya.Tween.to(this.label_show, {color:"#ff0000"}, 1000, Laya.Ease.strongIn, Laya.Handler.create(this, () => { - this.label_show.color = color - Laya.timer.clearAll(this) - })) } public setTipsBgColor(visible: boolean, noteNumber: number=0, color: string="", alpha: number=1): void { diff --git a/src/views/Stage.ts b/src/views/Stage.ts index 388182e..657e8ca 100644 --- a/src/views/Stage.ts +++ b/src/views/Stage.ts @@ -265,11 +265,11 @@ export class Stage extends Laya.Script { else { var sames = this.findSameNumberBlocks(block)//相同数字的格子 for (var i=0; i