Commit 1d18eacb authored by wjf's avatar wjf

l

parent 813ca7dc
......@@ -4,6 +4,7 @@ import { State } from "../class/State";
import { Pool } from "../Pool";
import { RecoverName } from "../enum/RecoverName";
import { ElementType } from "../enum/ElementType";
import { RES } from "../../../module/RES";
/**
* 变色气泡状态
......@@ -13,18 +14,18 @@ export class BubbleState extends State {
/**
* 显示图片
*/
private showImage: egret.Bitmap;
private showImage: FYGE.Sprite;
constructor(type: ElementType) {
super();
this.showImage = new egret.Bitmap();
this.changeSource("bubleEle" + type + "_png");
this.showImage = new FYGE.Sprite();
this.changeSource("bubleEle" + type + ".png");
this.addChild(this.showImage);
}
//重置为指定的类型,直接设置。没有过度动效
reset(type: ElementType) {
this.changeSource("bubleEle" + type + "_png");
this.changeSource("bubleEle" + type + ".png");
}
//直接回收
recover() {
......@@ -33,9 +34,9 @@ export class BubbleState extends State {
}
private changeSource(source: string) {
var texture: egret.Texture = RES.getRes(source);
var texture: FYGE.Texture = RES.getRes(source);
this.showImage.texture = texture;
this.showImage.x = -texture.textureWidth / 2;
this.showImage.y = -texture.textureHeight / 2
this.showImage.x = -texture.width / 2;
this.showImage.y = -texture.height / 2
}
}
\ No newline at end of file
......@@ -4,13 +4,14 @@ import { State } from "../class/State";
import { Pool } from "../Pool";
import { RecoverName } from "../enum/RecoverName";
import { ElementType } from "../enum/ElementType";
import { RES } from "../../../module/RES";
/**
* 黑色毛球状态
* 两次消除,需要修改图片,,,再说,还没写,切换眩晕状态,是否有动画,都再说
*/
export class HairballBlackState extends State {
private showImage: egret.Bitmap;
private showImage: FYGE.Sprite;
/**
* 是否激活
*/
......@@ -24,15 +25,15 @@ export class HairballBlackState extends State {
}
constructor() {
super();
this.showImage = new egret.Bitmap();
this.showImage = new FYGE.Sprite();
this.addChild(this.showImage);
this.changeSource("ele" + ElementType.HAIRBALLBLACK + "_png")
this.changeSource("ele" + ElementType.HAIRBALLBLACK + ".png")
this._isAwake = true;
}
reset() {
this._isAwake = true;
//换图
this.changeSource("ele" + ElementType.HAIRBALLBLACK + "_png")
this.changeSource("ele" + ElementType.HAIRBALLBLACK + ".png")
}
recover() {
if (this.parent) this.parent.removeChild(this);
......@@ -40,9 +41,9 @@ export class HairballBlackState extends State {
}
private changeSource(source: string) {
var texture: egret.Texture = RES.getRes(source);
var texture: FYGE.Texture = RES.getRes(source);
this.showImage.texture = texture;
this.showImage.x = -texture.textureWidth / 2;
this.showImage.y = -texture.textureHeight / 2
this.showImage.x = -texture.width / 2;
this.showImage.y = -texture.height / 2
}
}
\ No newline at end of file
......@@ -4,24 +4,25 @@ import { State } from "../class/State";
import { Pool } from "../Pool";
import { RecoverName } from "../enum/RecoverName";
import { ElementType } from "../enum/ElementType";
import { RES } from "../../../module/RES";
/**
* 褐色帽绣毛球状态
* 分裂动画都在外面单独掉
*/
export class HairballBrownState extends State {
private showImage: egret.Bitmap;
private showImage: FYGE.Sprite;
/**
* 是否激活
*/
isActive: boolean;
constructor() {
super();
var texture: egret.Texture = RES.getRes("ele" + ElementType.HAIRBALLBROWN + "_png")
this.showImage = new egret.Bitmap(texture);
var texture: FYGE.Texture = RES.getRes("ele" + ElementType.HAIRBALLBROWN + ".png")
this.showImage = new FYGE.Sprite(texture);
this.addChild(this.showImage);
this.showImage.x = -texture.textureWidth / 2;
this.showImage.y = -texture.textureHeight / 2;
this.showImage.x = -texture.width / 2;
this.showImage.y = -texture.height / 2;
this.isActive = false;
}
reset() {
......@@ -33,9 +34,9 @@ export class HairballBrownState extends State {
}
private changeSource(source: string) {
var texture: egret.Texture = RES.getRes(source);
var texture: FYGE.Texture = RES.getRes(source);
this.showImage.texture = texture;
this.showImage.x = -texture.textureWidth / 2;
this.showImage.y = -texture.textureHeight / 2
this.showImage.x = -texture.width / 2;
this.showImage.y = -texture.height / 2
}
}
\ No newline at end of file
......@@ -3,20 +3,21 @@
import { State } from "../class/State";
import { Pool } from "../Pool";
import { RecoverName } from "../enum/RecoverName";
import { RES } from "../../../module/RES";
/**
* 枷锁状态
* 动画比较简单,直接写这里
*/
export class LockState extends State {
private showImage: egret.Bitmap;
private showImage: FYGE.Sprite;
constructor() {
super();
var texture: egret.Texture = RES.getRes("lockVine_png")
this.showImage = new egret.Bitmap(texture);
var texture: FYGE.Texture = RES.getRes("lockVine.png")
this.showImage = new FYGE.Sprite(texture);
this.addChild(this.showImage);
this.showImage.x = -texture.textureWidth / 2;
this.showImage.y = -texture.textureHeight / 2
this.showImage.x = -texture.width / 2;
this.showImage.y = -texture.height / 2
}
reset() {
this.alpha = 1;
......@@ -24,7 +25,7 @@ export class LockState extends State {
//要不要把动画放在这里,这种移除动效最好统一外面,常驻动效才
recover() {
egret.Tween.get(this)
FYGE.Tween.get(this)
.to({ alpha: 0 }, 750)
.call(() => {
if (this.parent) this.parent.removeChild(this);
......
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