Commit 18601d69 authored by wildfirecode's avatar wildfirecode

1

parent ba185f36
{"file":"monsterState.png","frames":{
"糖果消失_00014":{"x":422,"y":462,"w":84,"h":100,"offX":56,"offY":46,"sourceW":200,"sourceH":200},
"糖果消失_00013":{"x":332,"y":462,"w":88,"h":105,"offX":55,"offY":44,"sourceW":200,"sourceH":200},
"糖果消失_00012":{"x":239,"y":370,"w":91,"h":106,"offX":54,"offY":42,"sourceW":200,"sourceH":200},
"糖果消失_00011":{"x":374,"y":348,"w":93,"h":112,"offX":52,"offY":40,"sourceW":200,"sourceH":200},
"糖果消失_00010":{"x":146,"y":370,"w":91,"h":110,"offX":53,"offY":40,"sourceW":200,"sourceH":200},
"糖果消失_00009":{"x":378,"y":131,"w":105,"h":109,"offX":53,"offY":42,"sourceW":200,"sourceH":200},
"糖果消失_00008":{"x":378,"y":0,"w":130,"h":129,"offX":41,"offY":33,"sourceW":200,"sourceH":200},
"糖果消失_00007":{"x":191,"y":0,"w":185,"h":184,"offX":14,"offY":6,"sourceW":200,"sourceH":200},
"糖果消失_00006":{"x":0,"y":344,"w":144,"h":143,"offX":34,"offY":26,"sourceW":200,"sourceH":200},
"糖果消失_00005":{"x":239,"y":478,"w":85,"h":84,"offX":63,"offY":55,"sourceW":200,"sourceH":200},
"糖果消失_00004":{"x":146,"y":482,"w":55,"h":59,"offX":73,"offY":69,"sourceW":200,"sourceH":200},
"糖果消失_00003":{"x":374,"y":242,"w":103,"h":104,"offX":49,"offY":47,"sourceW":200,"sourceH":200},
"糖果消失_00002":{"x":0,"y":192,"w":149,"h":150,"offX":26,"offY":24,"sourceW":200,"sourceH":200},
"糖果消失_00001":{"x":191,"y":186,"w":181,"h":182,"offX":10,"offY":8,"sourceW":200,"sourceH":200},
"糖果消失_00000":{"x":0,"y":0,"w":189,"h":190,"offX":6,"offY":4,"sourceW":200,"sourceH":200}}}
\ No newline at end of file
...@@ -231,6 +231,10 @@ ...@@ -231,6 +231,10 @@
{ {
"keys": "backindex_png", "keys": "backindex_png",
"name": "backindex" "name": "backindex"
},
{
"name": "preload",
"keys": "monsterState_json"
} }
], ],
"resources": [ "resources": [
...@@ -4467,6 +4471,12 @@ ...@@ -4467,6 +4471,12 @@
"url": "assets/mainScene/monster_shoot.png", "url": "assets/mainScene/monster_shoot.png",
"type": "image", "type": "image",
"name": "monster_shoot_png" "name": "monster_shoot_png"
},
{
"name": "monsterState_json",
"type": "sheet",
"url": "assets/mc/monsterState.json",
"subkeys": "糖果消失_00014,糖果消失_00013,糖果消失_00012,糖果消失_00011,糖果消失_00010,糖果消失_00009,糖果消失_00008,糖果消失_00007,糖果消失_00006,糖果消失_00005,糖果消失_00004,糖果消失_00003,糖果消失_00002,糖果消失_00001,糖果消失_00000"
} }
] ]
} }
\ No newline at end of file
...@@ -9,6 +9,7 @@ export class MyExmlPlugin extends ExmlPlugin2 implements plugins.Command { ...@@ -9,6 +9,7 @@ export class MyExmlPlugin extends ExmlPlugin2 implements plugins.Command {
async onFile(file: plugins.File) { async onFile(file: plugins.File) {
const excludes = [ const excludes = [
'candydiebg.png', 'candydiebg.png',
'monsterState.png',
'candysub.png', 'candysub.png',
'candydis0.png', 'candydis0.png',
......
import MovieClip from "../movieclip/MovieClip";
import { getEffectFramesStr } from "./createEffect1";
import wait from "../../libs/new_tc/wait";
export const createMonsterStatusAni = async (x, y, p) => {
const spritesheet = await RES.getResAsync('monsterState_json');
const list = getEffectFramesStr('糖果消失_000', 0, 14);
const movieclip = new MovieClip({
spritesheet: spritesheet,
frameInterval: 2,
frames: list,
position: [x, y],
scale: 1,
anchor: [.5, .5],
loop: false
});
p.addChild(movieclip);
movieclip.once(egret.Event.COMPLETE, () => {
if (movieclip.parent)
movieclip.parent.removeChild(movieclip);
}, this)
await wait(300)
}
\ No newline at end of file
...@@ -7,6 +7,7 @@ import wait from "../../libs/new_tc/wait"; ...@@ -7,6 +7,7 @@ import wait from "../../libs/new_tc/wait";
import { MonsterShootAni, monstShootAniDur } from "../something/anis/MonsterShootAni"; import { MonsterShootAni, monstShootAniDur } from "../something/anis/MonsterShootAni";
import { RecoverName } from "../something/enum/RecoverName"; import { RecoverName } from "../something/enum/RecoverName";
import { Pool } from "../something/Pool"; import { Pool } from "../something/Pool";
import { createMonsterStatusAni } from "../effect/createMonsterStatusAni";
/** /**
* 独眼怪爆炸 * 独眼怪爆炸
*/ */
...@@ -49,10 +50,12 @@ export default async (thisObj: MainScene) => { ...@@ -49,10 +50,12 @@ export default async (thisObj: MainScene) => {
foundsResult[index] = founds; foundsResult[index] = founds;
} }
for (let index = 0; index < activeMosterEles.length; index++) { const playEffect = async (index) => {
const monsterEle = activeMosterEles[index]; const monsterEle = activeMosterEles[index];
//找到相同颜色的元素 //找到相同颜色的元素
let founds = foundsResult[index]; let founds = foundsResult[index];
await createMonsterStatusAni(monsterEle.x, monsterEle.y, thisObj);
monsterEle.monster.hide();
founds.forEach((ele) => { founds.forEach((ele) => {
let bonusShootAni: MonsterShootAni = Pool.takeOut(RecoverName.MONSTER_SHOOT_ANI); let bonusShootAni: MonsterShootAni = Pool.takeOut(RecoverName.MONSTER_SHOOT_ANI);
if (!bonusShootAni) if (!bonusShootAni)
...@@ -61,10 +64,13 @@ export default async (thisObj: MainScene) => { ...@@ -61,10 +64,13 @@ export default async (thisObj: MainScene) => {
bonusShootAni.play(r * 180 / Math.PI, [monsterEle.x, monsterEle.y], [ele.x, ele.y], () => { }); bonusShootAni.play(r * 180 / Math.PI, [monsterEle.x, monsterEle.y], [ele.x, ele.y], () => { });
thisObj.addChild(bonusShootAni); thisObj.addChild(bonusShootAni);
}); });
};
for (let index = 0; index < activeMosterEles.length; index++) {
playEffect(index);
} }
if (genarateEffect.length > 0) if (genarateEffect.length > 0)
await wait(monstShootAniDur); await wait(monstShootAniDur + 300);
for (let index = 0; index < foundsResult.length; index++) { for (let index = 0; index < foundsResult.length; index++) {
const founds = foundsResult[index]; const founds = foundsResult[index];
founds.forEach(ele => { founds.forEach(ele => {
......
...@@ -364,16 +364,17 @@ export default class MapScene extends Scene { ...@@ -364,16 +364,17 @@ export default class MapScene extends Scene {
RES.getResAsync('candydie3_json'); RES.getResAsync('candydie3_json');
RES.getResAsync('candydie4_json'); RES.getResAsync('candydie4_json');
RES.getResAsync('candysub_json'); RES.getResAsync('candysub_json');
RES.getResAsync('monsterState_json');
RES.getResAsync('candydiebg_json'); RES.getResAsync('candydiebg_json');
RES.getResAsync('redrainbg_jpg'); RES.getResAsync('redrainbg_jpg');
RES.getResAsync('hbRule_bg_png'); RES.getResAsync('hbRule_bg_png');
loadSvga(getResPath() + 'resource/assets/svgas/monster0.svga');
loadSvga(getResPath() + 'resource/assets/svgas/monster1.svga'); loadSvga(getResPath() + 'resource/assets/svgas/monster1.svga');
loadSvga(getResPath() + 'resource/assets/svgas/monster2.svga'); loadSvga(getResPath() + 'resource/assets/svgas/monster2.svga');
loadSvga(getResPath() + 'resource/assets/svgas/monster3.svga'); loadSvga(getResPath() + 'resource/assets/svgas/monster3.svga');
loadSvga(getResPath() + 'resource/assets/svgas/monster4.svga'); loadSvga(getResPath() + 'resource/assets/svgas/monster4.svga');
loadSvga(getResPath() + 'resource/assets/svgas/monster5.svga');
loadSvga(getResPath() + 'resource/assets/svgas/box.svga'); loadSvga(getResPath() + 'resource/assets/svgas/box.svga');
loadSvga(getResPath() + 'resource/assets/svgas/invite.svga'); loadSvga(getResPath() + 'resource/assets/svgas/invite.svga');
loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga'); loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga');
......
import { ImageAni } from "../class/ImageAni";
import { Pool } from "../Pool";
import { RecoverName } from "../enum/RecoverName"; import { RecoverName } from "../enum/RecoverName";
import { playSound, SoundType } from "../../soundCtrl"; import { Pool } from "../Pool";
export const monstShootAniDur: number=500; export const monstShootAniDur: number=400;
/** /**
* 需要回调的 * 需要回调的
* 手动修改this.shoot.rotation= * 手动修改this.shoot.rotation=
......
import { ElementType } from "../enum/ElementType"; import { ElementType } from "../enum/ElementType";
import { loadSvga } from "../../loadSvga"; import { loadSvga } from "../../loadSvga";
import getResPath from "../../../libs/new_tc/getResPath"; import getResPath from "../../../libs/new_tc/getResPath";
import { createMonsterStatusAni } from "../../effect/createMonsterStatusAni";
const frames = [ const frames = [
[1, 120], [1, 120],
[121, 360], [121, 360],
...@@ -8,21 +9,30 @@ const frames = [ ...@@ -8,21 +9,30 @@ const frames = [
[601, 960], [601, 960],
]; ];
export class Monster extends eui.Component { export class Monster extends eui.Component {
nextStatus() { async nextStatus() {
this._statusNum++; this._statusNum++;
if (this._statusNum > 4) { if (this._statusNum > 4) {
this._statusNum = 4; this._statusNum = 4;
this.removeEvents(); this.removeEvents();
} }
//播放动画,动画时间要短200ms以内 //播放动画,动画时间要短200ms以内
if (this._statusNum <= 3) if (this._statusNum <= 3) {
createMonsterStatusAni(this.x, this.y, this.parent);
this.changeSource(); this.changeSource();
}
}
hide(){
this._mv.scaleX=this._mv.scaleY=0;
} }
resetStatus() { resetStatus() {
this.addEvents(); this.addEvents();
this._statusNum = 0; this._statusNum = 0;
this.changeSource(); this._mv.gotoAndPlay(1);
egret.Tween.get(this._mv).to({scaleY:1,scaleX:1},500,egret.Ease.backOut).call(()=>{
this.changeSource();
})
} }
get active(): boolean { get active(): boolean {
...@@ -40,7 +50,7 @@ export class Monster extends eui.Component { ...@@ -40,7 +50,7 @@ export class Monster extends eui.Component {
return `ele${this.res}_${this._statusNum}_png`; return `ele${this.res}_${this._statusNum}_png`;
} }
type; type;
constructor(res: ElementType, type: number, n: number = 0) { constructor(res: ElementType, type: number, n: number = 3) {
super(); super();
this.res = res; this.res = res;
this.type = type; this.type = type;
...@@ -62,7 +72,7 @@ export class Monster extends eui.Component { ...@@ -62,7 +72,7 @@ export class Monster extends eui.Component {
} }
onEnterFrame() { onEnterFrame() {
if (this._statusNum <=3 && this._mv.currentFrame == frames[this._statusNum][1]) { if (this._statusNum <= 3 && this._mv.currentFrame == frames[this._statusNum][1]) {
this._mv.gotoAndPlay(frames[this._statusNum][0]); this._mv.gotoAndPlay(frames[this._statusNum][0]);
} }
} }
......
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