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

	@Initialize{
	SetX(GetX);
	SetY(GetY);
	SetLife(30);
	SetScore(50);
	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{
	SetShotDirectionType(ABSOLUTE);
	if(BeVanished() == false){
	MasicPointAddNormal(0.5);
	MagicPowerAdd(false);
	loop(1 + scorebonus){
	let x = GetX + rand(-8,8);
	let y = GetY + rand(-8,8);
	CreateItem(ITEM_SCORE,x,y);
	}
	}
	}

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

	task Move(){
	if(GetY == 100){SetMovePosition02(GetCenterX+64,GetCenterY-128,30);}
	else if(GetY == 150){SetMovePosition02(GetCenterX-64,GetCenterY-64,30);}
	else if(GetY == 0){SetMovePosition02(GetCenterX,GetCenterY,30);}
	else if(GetY == 330){SetMovePosition02(GetCenterX-64,GetCenterY+64,30);}
	else if(GetY == 380){SetMovePosition02(GetCenterX+64,GetCenterY+128,30);}
	loop(200){yield;}
	SetMovePosition02(GetCenterX,0,50);
	loop(50){yield;}
	VanishEnemy;
	}

}