let img=GetCurrentScriptDirectory~"img\enemy.png";
LoadGraphic(img);
let anim=0;
let animb=0;

sub bluefairynew{
	SetTexture(img);
	if(GetSpeedX<0){
		animb++;
		anim=0;
		if(animb>=32){animb-=8;}
		if(animb<16){
			SetGraphicRect(floor(animb/4)*48, 32, floor(animb/4)*48+48, 64);
			SetGraphicAngle(180, 0, 0);
		}else{
			SetGraphicRect((floor(animb/4)-4)*48, 64, (floor(animb/4)-4)*48+48, 96);
			SetGraphicAngle(180, 0, 0);
		}
	}else if(GetSpeedX>0){
		animb++;
		anim=0;
		if(animb>=32){animb-=8;}
		if(animb<16){
			SetGraphicRect(floor(animb/4)*48, 32, floor(animb/4)*48+48, 64);
			SetGraphicAngle(0, 0, 0);
		}else{
			SetGraphicRect((floor(animb/4)-4)*48, 64, (floor(animb/4)-4)*48+48, 96);
			SetGraphicAngle(0, 0, 0);
		}
	}else{
		anim++;
		animb=0;
		if(anim>=16){anim=0;}
		SetGraphicRect(floor(anim/4)*48, 0, floor(anim/4)*48+48, 32);
		SetGraphicAngle(0, 0, 0);
	}
	SetGraphicScale(1, 1);
	SetAlpha(255);
	SetColor(255, 255, 255);
	DrawGraphic(GetX, GetY);
}

sub redfairynew{
	SetTexture(img);
	if(GetSpeedX<0){
		animb++;
		anim=0;
		if(animb>=32){animb-=8;}
		if(animb<16){
			SetGraphicRect(floor(animb/4)*48, 128, floor(animb/4)*48+48, 160);
			SetGraphicAngle(180, 0, 0);
		}else{
			SetGraphicRect((floor(animb/4)-4)*48, 160, (floor(animb/4)-4)*48+48, 192);
			SetGraphicAngle(180, 0, 0);
		}
	}else if(GetSpeedX>0){
		animb++;
		anim=0;
		if(animb>=32){animb-=8;}
		if(animb<16){
			SetGraphicRect(floor(animb/4)*48, 128, floor(animb/4)*48+48, 160);
			SetGraphicAngle(0, 0, 0);
		}else{
			SetGraphicRect((floor(animb/4)-4)*48, 160, (floor(animb/4)-4)*48+48, 192);
			SetGraphicAngle(0, 0, 0);
		}
	}else{
		anim++;
		animb=0;
		if(anim>=16){anim=0;}
		SetGraphicRect(floor(anim/4)*48, 96, floor(anim/4)*48+48, 128);
		SetGraphicAngle(0, 0, 0);
	}
	SetGraphicScale(1, 1);
	SetAlpha(255);
	SetColor(255, 255, 255);
	DrawGraphic(GetX, GetY);
}