script_enemy_main
{//Enemy Ԑ͔
	let current = GetCurrentScriptDirectory;
	let imgRW = current~"RW.png";
	let count = 0;
	let counter = 0;
	let am = 0;
	let angleBase = 0;
	
	@Initialize{
		SetX(GetX);
		SetY(GetY);
		
		SetLife(20);
		LoadGraphic(imgRW);
		SetTexture(imgRW);
		
		LoadUserShotData(current~"WeaponData.txt"); 
	}
	
	@MainLoop{
		SetCollisionA(GetX,GetY,10);
		SetCollisionB(GetX,GetY,10);
		
		alternative(count)
		case(10){SetMovePosition01(GetPlayerX,GetClipMaxY+30,8);}
		//Move
		//if(count==300){CreateShot01(GetX,GetY,6,GetAngleToPlayer,23,5);}
		//Shot
		if(GetY>GetClipMaxY+30){VanishEnemy;}
		//Vanish
		
		count++;
	}

	@Finalize{
		//ITEM_1UP//ITEM_BOMB//ITEM_SCORE
		CreateItem(ITEM_SCORE,GetX,GetY);
	}

	@DrawLoop{
		SetColor( 255, 255, 255);
		SetRenderState(ALPHA);
		MVD;
		SetGraphicAngle(0,0,0);

		//DrawText(count,224,240,20,255);
		DrawGraphic(GetX,GetY);
		if(am==10){am=0;}
		am++;
		yield;
	}
	task MVD{
		SetGraphicRect(171,3,207,35);//42,38
		if(am>=5){SetGraphicRect(171,41,207,73);}
	yield;
	}
	
	function CircleMove (Ox,Oy,dir,Speed){
        let x = GetX + Ox*cos(dir);
        let y = GetY + Oy*sin(dir);
        SetMovePosition01(x, y, Speed);
		//SetMovePosition03
    }
}