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

	@Initialize{
	SetX(GetX);
	SetY(GetY);
	SetLife(50);
	SetScore(80);
	SetDamageRate(100,33);
	LoadGraphic(imgzako);
	SetTexture(imgzako);
	SetGraphicRect(0,192,32,224);
	Shot(GetArgument);
	Move();
	}

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

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

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

	task Shot(level){

	let speed = 1;
	let speedadd = [0.2,0.4,0.5,0.7];
	let angle = [90,83,97];
	loop(80){yield;}
	if(level != 2){loop(4){CreateShot01(GetX,GetY,speed,angle[0],AQUA31,15);speed += speedadd[level];}}
	speed = 1;
	if(level >= 2){loop(4){CreateShot01(GetX,GetY,speed,angle[1],AQUA31,15);
			CreateShot01(GetX,GetY,speed,angle[2],AQUA31,15);speed += speedadd[level];}}

	}

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

}