Commit 10ce2672 authored by wildfirecode's avatar wildfirecode

:wq

:wq

`erge branch 'dev' of gitlab2.dui88.com:wanghongyuan/xiaoxiaole into dev
parents 2423e91a ea4871ac
...@@ -374,7 +374,7 @@ export class Tool { ...@@ -374,7 +374,7 @@ export class Tool {
//与右交换,先确定col!=Tool.colNum-1,不是最右排元素8 //与右交换,先确定col!=Tool.colNum-1,不是最右排元素8
if (col != Tool.colNum - 1) { if (col != Tool.colNum - 1) {
var latRight = lattices[i + 1]; var latRight = lattices[i + 1];
//能交换,并且类型不一致 //能交换,并且类型不一致,并未判断latRight是否judgeMatch,也就是未判断是否魔力鸟,但是不影响
if (judgeFall(latRight) && lat.element.type != latRight.element.type) { if (judgeFall(latRight) && lat.element.type != latRight.element.type) {
//判断向右,+2,+3 lat 先确定col<Tool.colNum - 3 //判断向右,+2,+3 lat 先确定col<Tool.colNum - 3
if (col < Tool.colNum - 3) { if (col < Tool.colNum - 3) {
......
...@@ -2,18 +2,32 @@ import { Ani } from "../class/Ani"; ...@@ -2,18 +2,32 @@ import { Ani } from "../class/Ani";
//已是中心原点 //已是中心原点
export class MagicLionAni extends Ani { export class MagicLionAni extends Ani {
downImage: egret.Bitmap; downImage: egret.DisplayObjectContainer;
upImage: egret.Bitmap; upImage: egret.Bitmap;
constructor() { constructor() {
super() super()
this.aniName = "MagicLionAni"; this.aniName = "MagicLionAni";
//下图
this.downImage = new egret.DisplayObjectContainer();
this.downImage.scaleX = this.downImage.scaleY = 0.7;
this.addChild(this.downImage)
var texture: egret.Texture = RES.getRes("magicLionBg_png") var texture: egret.Texture = RES.getRes("magicLionBg_png")
this.downImage = new egret.Bitmap(texture); let one = new egret.Bitmap(texture);
this.downImage.anchorOffsetX = texture.textureWidth / 2; one.anchorOffsetX = texture.textureWidth / 2;
this.downImage.anchorOffsetY = texture.textureHeight / 2; one.anchorOffsetY = texture.textureHeight / 2;
this.downImage.scaleX = this.downImage.scaleY = 0.7 this.downImage.addChild(one);
this.addChild(this.downImage); this.addEventListener(egret.Event.ENTER_FRAME, () => {
one.rotation -= 5;
}, this);
let other = new egret.Bitmap(texture);
other.anchorOffsetX = texture.textureWidth / 2;
other.anchorOffsetY = texture.textureHeight / 2;
this.downImage.addChild(other);
this.addEventListener(egret.Event.ENTER_FRAME, () => {
other.rotation -= 5;
}, this);
//上图 //上图
var texture: egret.Texture = RES.getRes("magicLion_png") var texture: egret.Texture = RES.getRes("magicLion_png")
this.upImage = new egret.Bitmap(texture); this.upImage = new egret.Bitmap(texture);
...@@ -21,7 +35,9 @@ export class MagicLionAni extends Ani { ...@@ -21,7 +35,9 @@ export class MagicLionAni extends Ani {
this.upImage.anchorOffsetY = texture.textureHeight / 2; this.upImage.anchorOffsetY = texture.textureHeight / 2;
// this.upImage.scaleX = this.upImage.scaleY = 0.7 // this.upImage.scaleX = this.upImage.scaleY = 0.7
this.addChild(this.upImage); this.addChild(this.upImage);
this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this) this.addEventListener(egret.Event.ENTER_FRAME, () => {
this.upImage.rotation += 2;
}, this)
} }
private onEnterFrame() { private onEnterFrame() {
this.downImage.rotation += 5; this.downImage.rotation += 5;
...@@ -43,7 +59,7 @@ export class MagicLionAni extends Ani { ...@@ -43,7 +59,7 @@ export class MagicLionAni extends Ani {
}) })
egret.Tween.get(this.upImage) egret.Tween.get(this.upImage)
.to({ scaleX: 1, scaleY: 1 }, 300) .to({ scaleX: 1, scaleY: 1 }, 300)
.to({ scaleX: 0, scaleY: 0,alpha:0 }, 200) .to({ scaleX: 0, scaleY: 0, alpha: 0 }, 200)
} }
} }
\ No newline at end of file
...@@ -146,6 +146,13 @@ export class Element extends eui.Component { ...@@ -146,6 +146,13 @@ export class Element extends eui.Component {
this.showImage.x = -texture.textureWidth / 2; this.showImage.x = -texture.textureWidth / 2;
this.showImage.y = -texture.textureHeight / 2; this.showImage.y = -texture.textureHeight / 2;
//特殊逻辑,因为魔力鸟动效要旋转,所以隐藏原图showImage
if (source == "magicLion_png") {
this.showImage.alpha = 0;
} else {
this.showImage.alpha = 1;
}
} }
reset(type: ElementType) { reset(type: ElementType) {
......
...@@ -10,7 +10,26 @@ export class MagicLionBgAni extends egret.DisplayObjectContainer { ...@@ -10,7 +10,26 @@ export class MagicLionBgAni extends egret.DisplayObjectContainer {
this.showImage.anchorOffsetY = texture.textureHeight / 2; this.showImage.anchorOffsetY = texture.textureHeight / 2;
this.showImage.scaleX = this.showImage.scaleY = 0.7 this.showImage.scaleX = this.showImage.scaleY = 0.7
this.addChild(this.showImage); this.addChild(this.showImage);
this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this) this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
let other = new egret.Bitmap(texture);
other.anchorOffsetX = texture.textureWidth / 2;
other.anchorOffsetY = texture.textureHeight / 2;
other.scaleX = other.scaleY = 0.7
this.addChild(other);
this.addEventListener(egret.Event.ENTER_FRAME, () => {
other.rotation -= 5;
}, this);
var upTexture: egret.Texture = RES.getRes("magicLion_png")
let up = new egret.Bitmap(upTexture);
up.anchorOffsetX = upTexture.textureWidth / 2;
up.anchorOffsetY = upTexture.textureHeight / 2;
this.addChild(up);
this.addEventListener(egret.Event.ENTER_FRAME, () => {
up.rotation += 2;
}, this);
} }
private onEnterFrame() { private onEnterFrame() {
this.showImage.rotation += 5; this.showImage.rotation += 5;
......
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