let img=GetCurrentScriptDirectory~"img\stg1enm.png";
let img_bg=GetCurrentScriptDirectory~"img\cdbg01a.png";
let img_bgb=GetCurrentScriptDirectory~"img\cdbg01b.png";
let black=GetCurrentScriptDirectory~"img\black.png";
LoadGraphic(img);
LoadGraphic(img_bg);
LoadGraphic(img_bgb);
LoadGraphic(black);
let anim=0;
let type=0;
let bgdist=0;

sub anim2{
	anim++;
	if(anim%15==0)
	{
	type++;
	}
	if(type==8)
	{
	type=0;
	}
	SetTexture(img);
	if(type<4)
	{
	SetGraphicRect(0+64*type, 0, 64+64*type, 64);
	}else{
	SetGraphicRect(0+64*(type-4), 0, 64+64*(type-4), 64);
	}
	SetGraphicAngle(0, 0, 0);
    SetRenderState(ALPHA);
	SetAlpha(255);
	DrawGraphic(GetX, GetY);
}

sub bg{
	SetTexture(black);
	SetGraphicRect(-1024, -1024, 1024, 1024);
	SetGraphicAngle(0, 0, 0);
    SetRenderState(ALPHA);
	SetAlpha(255);
	DrawGraphic(GetCenterX, GetCenterY);
	SetTexture(img_bg);
	SetGraphicRect(-1024, -1024, 1024, 1024);
	SetGraphicAngle(0, 0, 0);
    SetRenderState(ALPHA);
	SetAlpha(255);
	DrawGraphic(GetCenterX, GetCenterY-bgdist);
	SetTexture(img_bgb);
	SetGraphicRect(-1024, -1024, 1024, 1024);
	SetGraphicAngle(0, 0, 0);
    SetRenderState(ADD);
	SetAlpha(100);
	DrawGraphic(GetCenterX+bgdist, GetCenterY+bgdist);
	bgdist++;
	if(bgdist>256)
	{
	bgdist-=256;
	}
}