Commit e297bc12 authored by wildfirecode's avatar wildfirecode

1

parent ea56c329
import getResPath from "../../libs/new_tc/getResPath";
import { loadSvga } from "../loadSvga";
export const createSandDisAni = async (x, y, p) => {
const movieclip: any = await loadSvga(getResPath() + 'resource/assets/svgas/sand_dis.svga');
p.addChild(movieclip);
movieclip.anchorOffsetX= 100;
movieclip.anchorOffsetY= 100;
// movieclip.scaleX=movieclip.scaleY=0.5;
movieclip.x = x;
movieclip.y = y;
movieclip.once(egret.Event.COMPLETE, () => {
if (movieclip.parent)
movieclip.parent.removeChild(movieclip);
}, this);
}
\ No newline at end of file
......@@ -101,6 +101,7 @@ import { createHoneyDisAni } from '../effect/createHoneyDisAni';
import Sand, { getSandDisplayBlock } from '../something/Sand';
import { SandAni } from '../something/anis/SandAni';
import doSandAI from './doSandAI';
import { createSandDisAni } from '../effect/createSandDisAni';
const aniClass = {
"BoomAni": BoomAni,
......@@ -3049,7 +3050,7 @@ export default class MainScene extends Scene {
* 格子上的冰块破碎
* @param lat
*/
iceBroken(lat: Lattice) {
checkLatticeBroken(lat: Lattice) {
if (!lat) return;
if (lat.ice) {//带冰的lattice
const ice = lat.ice;
......@@ -3084,7 +3085,8 @@ export default class MainScene extends Scene {
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);
// this.playAni(RecoverName.SAND_ANI, p);
createSandDisAni(p[0],p[1],this)
}
}
......@@ -3177,7 +3179,7 @@ export default class MainScene extends Scene {
//检查附近所有元素
checkNebAll(latttice: Lattice, ele?: Element) {
//如果格子有冰
this.iceBroken(latttice);
this.checkLatticeBroken(latttice);
this.checkFireworksNebEle(latttice, ele);
this.checkFishNebEle(latttice);
//如果附近有石头
......
......@@ -426,6 +426,9 @@ export default class MapScene extends Scene {
loadSvga(getResPath() + 'resource/assets/svgas/honeypot_dispear.svga');
loadSvga(getResPath() + 'resource/assets/svgas/honeypot_change.svga');
loadSvga(getResPath() + 'resource/assets/svgas/honeypot_bubble.svga');
loadSvga(getResPath() + 'resource/assets/svgas/sand_standby.svga');
loadSvga(getResPath() + 'resource/assets/svgas/sand_move.svga');
loadSvga(getResPath() + 'resource/assets/svgas/sand_dis.svga');
// loadSvga(getResPath() + 'resource/assets/svgas/fireworks.svga');
if (!window['development']) {
......
import centerAnchor from "./block/centerAnchor";
import getResPath from "../../libs/new_tc/getResPath";
import { loadSvga } from "../loadSvga";
export default class Sand extends egret.Sprite {
constructor() {
super();
this.initSvga();
}
const sand = new egret.Bitmap(RES.getRes("ele36_png"));
this.addChild(sand);
centerAnchor(sand);
async initSvga() {
const movieclip: any = await loadSvga(getResPath() + 'resource/assets/svgas/sand_standby.svga');
movieclip.anchorOffsetX = 78 / 2;
movieclip.anchorOffsetY = 78 / 2;
this.addChild(movieclip);
}
}
......
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