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

	@Initialize{
	SetX(GetX);
	SetY(16);
	SetLife(600);
	SetScore(5000);
	SetDamageRate(150,100);
	LoadGraphic(imgzako);
	SetTexture(imgzako);
	SetGraphicRect(256,128,320,192);
	Shot(GetArgument);
	Move();
	}

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

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

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

	task Shot(level){
	loop(50){yield;}
	let a = 0;
	let bullet = [RED05,RED01,RED04,RED02,RED03];
	loop{let speed = 2 + level * 0.4;
	a++;
	if(a > 4){a = 0;}
	SetShotDirectionType(PLAYER);
	CreateShot01(GetX,GetY,speed,0,bullet[a],0);
	SetShotDirectionType(ABSOLUTE);
	loop(14 - level * 2){yield;}
	}
	}

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

}