

script_enemy_main
{
    let cx = GetCenterX();
    let cy = GetCenterY();
    let d = 0;
    let move = 0;
    let count = 0;
    let count2 = 0;
    let img=GetCurrentScriptDirectory~"img\dot_flandre.png";
    @Initialize()
    {
        SetLife(90000);//ForbidShot(true);ForbidBomb(true);
        SetGraphicRect(0,0,128,128);//CollectItems;
    }

    @MainLoop()
    {
        SetCollisionA(GetX(),GetY()-8,24);
        SetCollisionB(GetX(),GetY(),20);

        if (count == 1)
        {
            SetMovePositionRandom01(0,200,12,cx+120,98,cx+120,98);
            move=52;
        }
        if (count == 100)
        {
            VanishEnemy;
        }
        count++;
        move--;
        count2++;
    }

    @DrawLoop
    {
        SetTexture(GetCurrentScriptDirectory~"\img\dot_flandre.png");
        SetAlpha(255);
        SetGraphicAngle(0,0,0);
        SetColor(255,255,255);
        SetRenderState(ALPHA);
        SetGraphicScale(1,1);
        SetGraphicRect(0,0,128,128);
        if (count2/7%4>=0) {
            SetGraphicRect(0,0,128,128);
        }
        if (count2/7%4>=1) {
            SetGraphicRect(0,128,128,256);
        }
        if (count2/7%4>=2) {
            SetGraphicRect(0,256,128,384);
        }
        if (count2/7%4>=3) {
            SetGraphicRect(0,384,128,512);
        }
        if (GetSpeedX()<0&&move>0) {
            SetGraphicRect(256,0,384,128);
        }
        if (GetSpeedX()<0&&move>8) {
            SetGraphicRect(256,128,384,256);
        }
        if (GetSpeedX()>=0&&move>0) {
            SetGraphicRect(256,256,384,384);
        }
        if (GetSpeedX()>=0&&move>8) {
            SetGraphicRect(256,384,384,512);
        }
        DrawGraphic(GetX(),GetY());

    }

    @Finalize() {
        ForbidShot(false);
        ForbidBomb(false);
    }
}




