let imgsprite=GetCurrentScriptDirectory~"img\keine.png";
LoadGraphic(imgsprite);
let imgspell=GetCurrentScriptDirectory~"img\bg1a.png";
LoadGraphic(imgspell);
let imgspellb=GetCurrentScriptDirectory~"img\bg1b.png";
LoadGraphic(imgspellb);
let count=0;
let anim=0;
let spellbgdist=0;
let shine=1;

sub anim2{
	count=0;
	anim+=2;
	SetTexture(imgsprite);
	if(GetSpeedX<=0.2 && GetSpeedX>=-0.2)
	{
	SetGraphicRect(floor(anim/10)*64, 0, floor(anim/10)*64+64, 80);
	SetGraphicAngle(0, 0, 0);
	}
	if(GetSpeedX<-0.2 && GetSpeedX>=-1)
	{
	SetGraphicRect(64, 80, 128, 160);
	SetGraphicAngle(180, 0, 0);
	}
	if(GetSpeedX<-1)
	{
	SetGraphicRect(192, 80, 256, 160);
	SetGraphicAngle(180, 0, 0);
	}
	if(GetSpeedX>0.2 && GetSpeedX<=1)
	{
	SetGraphicRect(64, 80, 128, 160);
	SetGraphicAngle(0, 0, 0);
	}
	if(GetSpeedX>1)
	{
	SetGraphicRect(192, 80, 256, 160);
	SetGraphicAngle(0, 0, 0);
	}
	SetGraphicScale(1, 1);
	SetAlpha(255);
	SetRenderState(ALPHA);
	DrawGraphic(GetX, GetY);
}

sub animation{
	anim=0;
	count++;
	SetTexture(imgsprite);
	if(count<=20)
	{
	SetGraphicRect(floor(count/10)*64, 160, floor(count/10)*64+64, 240);
	}else{
	SetGraphicRect(192, 160, 256, 240);
	}
	SetGraphicScale(1, 1);
	SetAlpha(255);
	SetGraphicAngle(0, 0, 0);
	SetRenderState(ALPHA);
	DrawGraphic(GetX, GetY);
}
sub animationb{
	shine++;
	anim+=2;
	SetTexture(imgsprite);
	SetGraphicRect(floor(anim/10)*64, 0, floor(anim/10)*64+64, 80);
	SetGraphicScale(1, 1);
	SetAlpha(shine);
	SetGraphicAngle(0, 0, 0);
	SetRenderState(ADD);
	if(shine<=255)
	{
	DrawGraphic(GetX, GetY);
	}
}

sub spellbg
{
	spellbgdist++;
	if(spellbgdist>=256){spellbgdist-=256;}
	SetTexture(imgspell);
	SetGraphicRect(0, 0, 256, 256);
	SetGraphicScale(2, 2);
	SetAlpha(255);
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetCenterX, GetCenterY);
	SetTexture(imgspellb);
	SetGraphicRect(0, 0, 1024, 1024);
	SetGraphicScale(1, 1);
	SetAlpha(255);
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetCenterX-spellbgdist, GetCenterY-spellbgdist);
}