script_enemy_main {
#include_function ".\lib.txt"
let imgAngle=0;
@Initialize{
    SetLife(10);
    LoadStuff;
	LoadUserShotData(GetCurrentScriptDirectory~"Shot.txt");
	MainTask;
	}
@MainLoop{
	imgAngle+=10;
    yield;
	}
@DrawLoop{
    SetAlpha(255);
	SetColor(255,255,255);
	SetGraphicAngle(0,0,imgAngle);
	SetTexture(Enemy);
	SetGraphicRect(0,0,32,32);
	DrawGraphic(GetX,GetY);
	}
@Finalize{
	DeleteStuff;
	}
task MainTask{
	Tail;
	loop{
		CreateShotA(0, GetX, GetY, 10);
		SetShotDataA(0, 0, 5, 90, rand(-0.2, 0.2), 0, 0, 195);
		FireShot(0);
		Wait(20);
		}
	}
task Tail{
	loop{
		CreateShotA(0,GetX,GetY,60);
		SetShotDataA(0,0,0,0,0,0,0,200);
		SetShotKillTime(0,0);
		FireShot(0);
		Wait(5);
		}
	}
task KillFam{
	loop{
		if (GetX == GetClipMinX){ SetLife(0);}
		yield;
	}}
}
