script_enemy_main {

    #include_function ".\enemyanim.txt"
	let frame = 0;

	@Initialize {
		SetDamageRate(100, 100);
		SetLife(15);
		if(GetX>GetCenterX){
			SetMovePosition02(GetClipMinX-50, GetY-100, 150);
		}else{
			SetMovePosition02(GetClipMaxX+50, GetY-100, 150);
		}
		LoadUserShotData(GetCurrentScriptDirectory~"supershot.txt");
	}
	
	@MainLoop{
		SetCollisionA(GetX, GetY, 12);
		SetCollisionB(GetX, GetY, 12);
		frame++;
		if(frame%25==0){PlaySE(GetCurrentScriptDirectory~"sound\Shot1.wav"); ascent(i in 2..4){CreateShot01(GetX, GetY, i, GetAngleToPlayer, 32, 10);}}
		if(frame>100 && (GetX>GetClipMaxX+20 || GetX<GetClipMinX-20)){VanishEnemy;}
        yield;
	}
		
	@DrawLoop {
		redfairynew;
	}
	
	@Finalize {
		if(GetX<GetClipMaxX && GetX>GetClipMinX && GetY>GetClipMinY && GetY<GetClipMaxY){
			CreateItem(ITEM_SCORE, GetX, GetY);
		}
	}
}