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

	@Initialize{
	SetX(GetX);
	SetY(GetY);
	SetLife(80);
	SetScore(120);
	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(1);
	MagicPowerAdd(true);
	loop(2 + 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){
	WideShot01(GetX,GetY,speed,angle,3+3*level,5,GREEN21,12);
	speed += 0.5;}
	loop(50/(level + 1)){yield;}
	}
	}

	task Move(){
	SetMovePosition02(GetX,GetClipMaxY+32,400);
	loop(450){yield;}
	VanishEnemy;
	}

}