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

	@Initialize{
	SetX(GetX);
	SetY(16);
	SetLife(140);
	SetScore(500);
	SetDamageRate(100,16);
	LoadGraphic(imgzako);
	SetTexture(imgzako);
	SetGraphicRect(0,192,32,224);
	Shot(GetArgument);
	Move();
	}

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

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

	@Finalize{
	SetShotDirectionType(ABSOLUTE);
	MasicPointAddNormal(2);
	MagicPowerAdd(false);
	if(BeVanished() == false){
	loop(scorebonus * 4){
	let x = GetX + rand(-96,96);
	let y = GetY + rand(-96,96);
	CreateItem(ITEM_SCORE,x,y);}
	}
	}

	task Move(){
	loop(4){
	SetMovePosition02(GetX+48,GetY,50);
	loop(100){yield;}
	SetMovePosition02(GetX,GetY+50,50);
	loop(100){yield;}
	SetMovePosition02(GetX-48,GetY,50);
	loop(100){yield;}
	SetMovePosition02(GetX,GetY+50,50);
	loop(100){yield;}
	}
	VanishEnemy;
	}

	task Shot(level){
	loop(30){yield;}
	loop{
	let speed = 2;
	let angle = 90;

	if(level != 2){CreateShot01(GetX,GetY,speed,angle,PURPLE23,0);}

	if(level >= 2){
	CreateShot01(GetX,GetY,speed,angle-90,PURPLE23,0);
	CreateShot01(GetX,GetY,speed,angle+90,PURPLE23,0);
	CreateShot01(GetX,GetY,speed,angle-45,PURPLE23,0);
	CreateShot01(GetX,GetY,speed,angle+45,PURPLE23,0);
	}

	loop(60){yield;}
	}
	}

}