Commit c49cdf1e authored by wildfirecode's avatar wildfirecode

1

parent 2e5c2c2c
......@@ -98,10 +98,13 @@ import doHoneyPotAI from './doHoneyPotAI';
import doMonsterAI from './doMonsterAI';
import jellyMonsterAI from './jellyMonsterAI';
import { createHoneyDisAni } from '../effect/createHoneyDisAni';
import Sand, { getSandDisplayBlock } from '../something/Sand';
import { SandAni } from '../something/anis/SandAni';
const aniClass = {
"BoomAni": BoomAni,
"IceAni": IceAni,
"SandAni": SandAni,
"RockAni": RockAni,
"HorizontalAni": HorizontalAni,
"VerticalAni": VerticalAni,
......@@ -620,13 +623,13 @@ export default class MainScene extends Scene {
latticeDisplay = ice;
this.lattices[i].ice = ice;
} else if (isSand(latticesD[i])) {
// latticeDisplay = genBlockDisplay(latticesD[i]);
// this.lattices[i].block = latticeDisplay as BaseBlock;
} else if(isBlock(latticesD[i])) {
latticeDisplay = getSandDisplayBlock();
this.lattices[i].sand = latticeDisplay as Sand;
} else if (isBlock(latticesD[i])) {
latticeDisplay = genBlockDisplay(latticesD[i]);
this.lattices[i].block = latticeDisplay as BaseBlock;
}
if(latticeDisplay) {
if (latticeDisplay) {
this.map.addChild(latticeDisplay);
latticeDisplay.x = p[0];
latticeDisplay.y = p[1];
......@@ -3075,8 +3078,13 @@ export default class MainScene extends Scene {
const p = Tool.getPositionByIndex(lat.index);
//动画
this.playAni(RecoverName.ICE_ANI, p);
} else if (lat.sand) {
lat.sand && lat.sand.parent && lat.sand.parent.removeChild(lat.sand);
this.goElementTarget(ElementType.SAND, [lat.sand.x, lat.sand.y]);
lat.sand = null;
const p = Tool.getPositionByIndex(lat.index);
this.playAni(RecoverName.SAND_ANI, p);
}
}
goElementTarget(type: ElementType, fromP: number[]) {
......
import centerAnchor from "./block/centerAnchor";
export default class Sand extends egret.Sprite {
constructor() {
super();
const sand = new egret.Bitmap(RES.getRes("ele36_png"));
this.addChild(sand);
centerAnchor(sand);
}
}
export const getSandDisplayBlock = () => {
return new Sand();
}
\ No newline at end of file
import { Ani } from "../class/Ani";
import { ImageAni } from "../class/ImageAni";
import { ElementType } from "../enum/ElementType";
//原点已是中心
export class SandAni extends Ani {
/**
* 图片
*/
showImage: ImageAni;
constructor() {
super();
this.aniName = "SandAni";
this.showImage = new ImageAni(["ele" + ElementType.ICE + "_png", "ice2_png", "ice3_png", "ice4_png", "ice5_png", "ice6_png"]);
this.addChild(this.showImage)
}
play() {
//重置图片
this.showImage.currentFrame = 0;
this.showImage.source = this.showImage.sourceAll[0];
this.showImage.play(() => {
this.recover();
})
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ import BaseBlock from "../block/BaseBlock";
import { Tool } from "../Tool";
import { Element } from "./Element";
import { Ice } from "./Ice";
import Sand from "../Sand";
/**
* 位置信息直接用一个二维数组记录,然后用row,col取
......@@ -18,7 +19,7 @@ export class Lattice {
* 石门,冰石门,深冰石门
*/
block: BaseBlock;
sand: BaseBlock;
sand: Sand;
/**
* 上面的元素(null,消除元素,石头,冰激凌等),
*/
......
......@@ -47,6 +47,7 @@ export enum RecoverName {
//所有继承ani的,能单独播放的,不带回调的
ROCK_ANI = "RockAni",
ICE_ANI = "IceAni",
SAND_ANI = "SandAni",
BOOM_ANI = "BoomAni",
CANDY_DIS_ANI = "CandyDisAni",
ELEDIS_ANI = "EleDisAni",
......
......@@ -2272,121 +2272,6 @@
"levelNum": 452,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 453,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 454,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 455,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 456,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 457,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 458,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 459,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 460,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 461,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 462,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 463,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 464,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 465,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 466,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 467,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 468,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 469,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 470,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 471,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 472,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 473,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 474,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 475,
"maxScore": 47440,
"stars": 1
}
],
......
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