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

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

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

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

	@Finalize{
	if(BeVanished() == false){
	MasicPointAddNormal(2.5);
	loop(6 + scorebonus){
	let x = GetX + rand(-8,8);
	let y = GetY + rand(-8,8);
	CreateItem(ITEM_SCORE,x,y);
	}
	}
	}

	task Shot(level){
	loop{
	loop(30){yield;}
	let angle = GetAngleToPlayer;
	let speed = 1.5;
	loop(2+level){
	RoundWideShot01(GetX,GetY,speed,angle,10,5,3*(level+1),GREEN21,12);
	speed += 0.5;}
	speed = 2;
	angle = 45;
	loop(level * 6){
	loop(4){CreateShot01(GetX,GetY,speed,angle,YELLOW21,12);
	if(level >= 2){CreateShot01(GetX,GetY,speed,angle+45,YELLOW21,12);}
	angle+= 90;}
	}
	loop(50/(level + 1)){yield;}
	}
	}

	task Move(){
	SetMovePosition02(GetX,GetCenterY,40);
	loop(320){yield;}
	SetMovePosition02(GetX,0,100);
	loop(130){yield;}
	VanishEnemy;
	}

}