Commit 70ba928f authored by wildfirecode's avatar wildfirecode

1

parent 5efe3dd0
...@@ -138,8 +138,8 @@ ...@@ -138,8 +138,8 @@
// localStorage.clear(); // localStorage.clear();
window['imgver'] = '11112'; window['imgver'] = '11112';
//top 8 ,repeat 22 , bottom 3 //top 8 ,repeat 22 , bottom 3
window['total_level'] = 8 + 3 + 22 * 20; window['total_level'] = 8 + 3 + 22 * 19;
window['last_level'] = 451; window['last_level'] = 425;
var sharePic = document.getElementById('pic'); var sharePic = document.getElementById('pic');
......
...@@ -3,6 +3,7 @@ import { ElementType } from "../something/enum/ElementType"; ...@@ -3,6 +3,7 @@ import { ElementType } from "../something/enum/ElementType";
import wait from "../../libs/new_tc/wait"; import wait from "../../libs/new_tc/wait";
import { Tool } from "../something/Tool"; import { Tool } from "../something/Tool";
import { Lattice } from "../something/class/Lattice"; import { Lattice } from "../something/class/Lattice";
import { RecoverName } from "../something/enum/RecoverName";
/** /**
* fish爆炸 * fish爆炸
*/ */
...@@ -20,19 +21,24 @@ export default async (thisObj: MainScene) => { ...@@ -20,19 +21,24 @@ export default async (thisObj: MainScene) => {
} }
for (const index of indexs) { for (const index of indexs) {
const lat: Lattice = thisObj.lattices[index]; const lat: Lattice = thisObj.lattices[index];
lat.element['fish'].toExplose();
// wait(1000).then(()=>{
const p = Tool.getPositionByIndex(index);
var boomAni = thisObj.playAni(RecoverName.BOOM_ANI, p);
boomAni.scaleX = boomAni.scaleY = 1;
// });
for (var i = 0; i < thisObj.lattices.length; i++) { for (var i = 0; i < thisObj.lattices.length; i++) {
if (Tool.judgeEliminate(thisObj.lattices[i]) && if (Tool.judgeEliminate(thisObj.lattices[i]) &&
(Math.abs(thisObj.lattices[i].row - lat.row) < 2 && Math.abs(thisObj.lattices[i].column - lat.column) < 2)) { (Math.abs(thisObj.lattices[i].row - lat.row) < 2 && Math.abs(thisObj.lattices[i].column - lat.column) < 2)) {
if (thisObj.eliminatedElements.indexOf(thisObj.lattices[i].index) < 0) { if (thisObj.eliminatedElements.indexOf(thisObj.lattices[i].index) < 0) {
thisObj.eliminatedElements.push( thisObj.lattices[i].index); thisObj.eliminatedElements.push(thisObj.lattices[i].index);
} }
} }
} }
} }
await wait(500); await wait(500);
//然后再消除四周的 // await wait(500+1000);
return indexs; return indexs;
} }
\ No newline at end of file
...@@ -371,6 +371,7 @@ export default class MapScene extends Scene { ...@@ -371,6 +371,7 @@ export default class MapScene extends Scene {
RES.getResAsync('hbRule_bg_png'); RES.getResAsync('hbRule_bg_png');
loadSvga(getResPath() + 'resource/assets/svgas/fish.svga');
loadSvga(getResPath() + 'resource/assets/svgas/monster0.svga'); 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');
......
This diff is collapsed.
...@@ -29,6 +29,7 @@ import { FestivalEle2 } from "./FestivalEle2"; ...@@ -29,6 +29,7 @@ import { FestivalEle2 } from "./FestivalEle2";
import { Monster } from "./Monster"; import { Monster } from "./Monster";
import { State } from "./State"; import { State } from "./State";
import wait from "../../../libs/new_tc/wait"; import wait from "../../../libs/new_tc/wait";
import { Fish } from "./Fish";
/** /**
* 考虑到底继承白鹭的啥Component还是Container * 考虑到底继承白鹭的啥Component还是Container
* 坐标原点需要坐落在格子的中心点 * 坐标原点需要坐落在格子的中心点
...@@ -49,7 +50,7 @@ export class Element extends eui.Component { ...@@ -49,7 +50,7 @@ export class Element extends eui.Component {
await wait(1000); await wait(1000);
this._fishState++; this._fishState++;
if (this._fishState == 1) { if (this._fishState == 1) {
this.changeSource("ele33_1_png"); this['fish'].toActive();
} }
} }
...@@ -163,10 +164,10 @@ export class Element extends eui.Component { ...@@ -163,10 +164,10 @@ export class Element extends eui.Component {
resetToFishView() { resetToFishView() {
this._fishState = 0; this._fishState = 0;
this._isNeb = false; this._isNeb = false;
this['fish'] = new Fish();
this.addChild(this['fish']);
this.changeSource("ele33_0_png"); this.changeSource("ele33_0_png");
// this.monster = new Monster(res,this.type); this.showImage.alpha = 0;
// this.addChild(this.monster);
// this.showImage.alpha = 0;
} }
private _candy: Candy; private _candy: Candy;
...@@ -452,6 +453,11 @@ export class Element extends eui.Component { ...@@ -452,6 +453,11 @@ export class Element extends eui.Component {
this.monster.removeEvents(); this.monster.removeEvents();
this.monster = null; this.monster = null;
} }
if (this['fish']) {
this.removeChild(this['fish']);
this['fish'].removeEvents();
this['fish'] = null;
}
//如果类型是节日红包大 //如果类型是节日红包大
if (type == ElementType.FESTIVALELE_BIG) { if (type == ElementType.FESTIVALELE_BIG) {
this.festivalEle = this.festivalEle || Pool.takeOut(RecoverName.FESTIVAL_ELE) this.festivalEle = this.festivalEle || Pool.takeOut(RecoverName.FESTIVAL_ELE)
......
import { ElementType } from "../enum/ElementType";
import { loadSvga } from "../../loadSvga";
import getResPath from "../../../libs/new_tc/getResPath";
import { createMonsterStatusAni } from "../../effect/createMonsterStatusAni";
const frames = [
[1, 120],
[121, 360],
[361, 600],
[601, 960],
];
export class Fish extends eui.Component {
_mv;
constructor() {
super();
this.initSvga();
}
async initSvga() {
const mv: any = await loadSvga(getResPath() + 'resource/assets/svgas/fish.svga');
this._mv = mv;
this.addChild(mv);
mv.anchorOffsetX = 80 / 2;
mv.anchorOffsetY = 80 / 2;
this.addEvents();
this.toStandBy();
}
toStandBy() {
this._mv.gotoAndPlay(1);
this._start = 1
this._end = 180
}
toActive() {
this._mv.gotoAndPlay(181);
this._start = -1
this._end = -1
}
toExplose() {
this._mv.stop();
// this._mv.gotoAndPlay(361);
// this._start = -1
// this._end = -1
}
private addEvents() {
this._mv.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
}
private _start = -1;
private _end = -1;
onEnterFrame() {
if (this._mv.currentFrame == 240) {
this._start = 241;
this._end = 360;
}
if (this._mv.currentFrame == (361+1)) {
this._start = -1;
this._end = -1;
this._mv.stop();
this.removeEvents();
}
if (this._start != -1 && this._end != -1) {
if (this._mv.currentFrame == this._end) {
this._mv.gotoAndPlay(this._start);
}
}
}
removeEvents() {
this._mv.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
}
}
\ No newline at end of file
...@@ -1132,7 +1132,7 @@ ...@@ -1132,7 +1132,7 @@
"maxScore": 47440, "maxScore": 47440,
"stars": 1 "stars": 1
}, },
{ {
"levelNum": 226, "levelNum": 226,
"maxScore": 47440, "maxScore": 47440,
......
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