script_enemy_main
{
	#include_function ".\Bullet_function.txt"
	#include_function ".\Enemy function.txt"

	@Initialize{
	SetX(GetX);
	SetY(GetY);
	SetLife(10);
	SetScore(10);
	SetDamageRate(100,33);
	LoadGraphic(imgzako);
	SetTexture(imgzako);
	SetGraphicRect(192,64,256,96);
	Shot(GetArgument);
	Move();
	}

	@MainLoop{
	SetCollisionA(GetX,GetY,24);
	ChackBonus;
	yield;
	}

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

	@Finalize{
	SetShotDirectionType(ABSOLUTE);
	if(BeVanished() == false){
	loop(scorebonus){
	let x = GetX + rand(-16,16);
	let y = GetY + rand(-16,16);
	CreateItem(ITEM_SCORE,x,y);
	}
	}
	}

	task Shot(level){
	loop(50){yield;}
	loop{let speed = 1;
	let angle = -level * 12 - 4;
	loop(level * 4){
	SetShotDirectionType(PLAYER);
	CreateShot01(GetX,GetY,speed,angle,ORANGE05,20);
	angle += 8;
	}
	SetShotDirectionType(ABSOLUTE);
	loop(120 - level * 20){yield;}
	}
	}

	task Move(){
	if(GetX <= GetCenterX){SetMovePosition02(GetClipMaxX,GetY,150);}
	else if(GetX >= GetCenterX){SetMovePosition02(GetClipMinX,GetY,150);}
	loop(150){yield;}
	VanishEnemy;
	}

}