import { Ani } from "../class/Ani";
import { ElementType } from "../enum/ElementType";
import { RecoverName } from "../enum/RecoverName";
import { RES } from "../../../module/RES";

//原点已是中心
export class RockAni extends Ani {
    /**
     * 图片
     */
    showImage: FYGE.FrameAni;
    constructor() {
        super();
        this.aniName = RecoverName.ROCK_ANI// "RockAni";
        var arr = []
        arr.push(RES.getRes("ele" + ElementType.ROCK + ".png"))
        for (var i = 2; i <= 6; i++)arr.push(RES.getRes("rock" + i + ".png"))
        this.showImage = new FYGE.FrameAni(arr);
        this.addChild(this.showImage)
    }

    play() {
        //重置图片
        this.showImage.reset(0);
        this.showImage.play(1, () => {
            this.recover();
        })
    }
} 