Commit 587ee86b authored by wildfirecode's avatar wildfirecode

1

parent b76a017a
......@@ -4,6 +4,7 @@ import { ElementType } from "../something/enum/ElementType";
import { AiControl } from "../something/logic/AiControl";
import { Tool } from "../something/Tool";
import MainScene from "./MainScene";
import jellyMonsterAni from "./jellyMonsterAni";
export default async (thisObj: MainScene) => {
//找到所有的怪物
......@@ -36,8 +37,9 @@ export default async (thisObj: MainScene) => {
spread = spreads.splice(i, 1)[0];
const [fromIndex, toIndex] = spread;
const fromEle: Element = thisObj.lattices[fromIndex].element;//起始元素
await fromEle.toAction();//准备开始吹
const endEle: Element = thisObj.lattices[toIndex].element; //终点元素
await fromEle.toAction();//准备开始吹
await jellyMonsterAni(thisObj,[fromEle.x,fromEle.y],[endEle.x,endEle.y]);
endEle.reset(ElementType.JELLY);
endEle.isMonsterJelly = true;
}
......
export default () => {
import MainScene from "./MainScene";
export default (thisobj: MainScene, from: number[], to: number[]) => {
//每次只有一个怪物吹气泡
return new Promise((r) => {
r();
const tex: egret.Texture = RES.getRes("ele20_png");
const pic = new egret.Bitmap(tex);
pic.anchorOffsetX = tex.textureWidth / 2;
pic.anchorOffsetY = tex.textureHeight;
pic.x = from[0];
pic.y = from[1] + 20;
thisobj.addChild(pic);
egret.Tween.get(pic).set({ scaleX: 0, scaleY: 0 })
.to({ scaleX: 1.1, scaleY: 0.9 }, 300)
.to({ scaleX: 0.9, scaleY: 1.1 }, 100)
.to({ scaleX: 1.05, scaleY: 0.95 }, 100)
.to({ scaleX: 1, scaleY: 1 }, 100)
.wait(300)
.set({ anchorOffsetY: tex.textureHeight / 2, y: from[1] + 20 - tex.textureHeight / 2 })
.to({x:to[0],y:to[1]},500)
.to({ scaleX: 0.9, scaleY: 1.1 }, 100)
.to({ scaleX: 1.05, scaleY: 0.95 }, 100)
.to({ scaleX: 1, scaleY: 1 }, 100).call(r)
// r();
});
}
\ No newline at end of file
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