let imgsprite=GetCurrentScriptDirectory~"img\alice_sprite.png";
LoadGraphic(imgsprite);
let imgspell=GetCurrentScriptDirectory~"img\spellbg.png";
LoadGraphic(imgspell);
let imgblack=GetCurrentScriptDirectory~"img\black.png";
LoadGraphic(imgblack);
let count=0;
let anim=0;
let spellbgdist=0;

sub anim2{
	count=0;
	anim=0;
	SetTexture(imgsprite);
	if(GetSpeedX<=0.2 && GetSpeedX>=-0.2){SetGraphicRect(0, 0, 128, 128);}
	if(GetSpeedX<-0.2 && GetSpeedX>=-1){SetGraphicRect(256, 0, 384, 128);}
	if(GetSpeedX<-1){SetGraphicRect(256, 128, 384, 256);}
	if(GetSpeedX>0.2 && GetSpeedX<=1){SetGraphicRect(256, 256, 384, 384);}
	if(GetSpeedX>1){SetGraphicRect(256, 384, 384, 512);}
	SetGraphicScale(1, 1);
	SetAlpha(255);
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetX, GetY);
}

sub animation{
	if(count<29){count++;}
	SetTexture(imgsprite);
	if(count<15)
	{
	SetGraphicRect(512, floor(count/5)*128, 640, floor(count/5)*128+128);
	}else{
	SetGraphicRect(640, floor((count-15)/5)*128, 768, floor((count-15)/5)*128+128);
	}
	SetGraphicScale(1, 1);
	SetAlpha(255);
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetX, GetY);
}
sub spellbg
{
	if(spellbgdist>256){spellbgdist-=256;}
	SetTexture(imgblack);
	SetGraphicRect(0, 0, 1000, 1000);
	SetGraphicScale(1, 1);
	SetAlpha(255);
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetCenterX, GetCenterY);
	SetTexture(imgspell);
	SetGraphicRect(0, 0, 256, 256);
	SetGraphicScale(1.5, 1.5);
	SetAlpha(255);
	SetGraphicAngle(0, 0, 0);
	ascent(i in -1..2)
	{
	DrawGraphic(GetCenterX, GetCenterY-spellbgdist+i*256);
	}
	spellbgdist++;
}