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

	@Initialize{
	SetX(GetX);
	SetY(GetClipMinY -32);
	SetLife(300);
	SetDamageRate(100,20);
	SetScore(2500);
	LoadGraphic(imgzako);
	SetTexture(imgzako);
	SetGraphicRect(256,0,320,64);
	Shot(GetArgument);
	Move();
	}

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

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

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

	task Shot(level){
	loop(70){yield;}
	loop{
	AroundToShot(GetX,GetY,64,30,0,1,90,0,false,false,RED21,20);
	AroundToShot(GetX,GetY,64,30,0,1,270,0,false,false,RED21,20);
	AroundToShot(GetX,GetY,48,32,0,1,90,0,false,false,RED21,20);
	AroundToShot(GetX,GetY,48,32,0,1,270,0,false,false,RED21,20);
	if(level >= 1){
	AroundToShot(GetX,GetY,64,18,0,1,85,0,false,false,PURPLE21,20);
	AroundToShot(GetX,GetY,64,18,0,1,265,0,false,false,PURPLE21,20);
	AroundToShot(GetX,GetY,48,20,0,1,85,0,false,false,PURPLE21,20);
	AroundToShot(GetX,GetY,48,20,0,1,265,0,false,false,PURPLE21,20);
	}
	if(level >= 2){
	AroundToShot(GetX,GetY,64,25,0,1,95,0,false,false,GREEN21,20);
	AroundToShot(GetX,GetY,64,25,0,1,275,0,false,false,GREEN21,20);
	AroundToShot(GetX,GetY,48,16,0,1,95,0,false,false,GREEN21,20);
	AroundToShot(GetX,GetY,48,16,0,1,275,0,false,false,GREEN21,20);
	}
	if(level >= 3){
	AroundToShot(GetX,GetY,16,60,0,2,90,0,false,false,RED21,20);
	}
	loop(120){yield;}
	}
	}

	task Move(){
	SetMovePosition02(GetX,GetClipMinY+92,60);
	loop(930){yield;}
	SetMovePosition02(GetX,GetClipMinY-32,60);
	loop(70){yield;}
	VanishEnemy;
	}

}