Commit 1d18eacb authored by wjf's avatar wjf

l

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