#e
#Title[wuV_l̍דv]
#Text[]
#ScriptVersion[2]
script_enemy_main
{
	let count=0;
	let cx=GetCenterX();//STGV[̒SxW擾
	let cy=GetCenterY();//STGV[̒SyW擾
	let imgExRumia=GetCurrentScriptDirectory~"img\ExRumia.png";
	let compus=GetCurrentScriptDirectory~"img\wi.png";
	let forest=GetCurrentScriptDirectory~"img\wi2.png";
	LoadUserShotData(GetCurrentScriptDirectory~"shot.txt");
	@Initialize
	{
		SetScore(30000);
		SetLife(500);
		SetDamageRate(10,8);
		SetMovePosition02(cx,cy-120,60);
		SetTimer(60);
		SetGraphicRect(1,1,64,64);
		SetInvincibility(60);
		LoadGraphic(imgExRumia);
		SetTexture(imgExRumia);	
		LoadGraphic(compus);
		LoadGraphic(forest);
		shottask;
		subtask;
		CutIn(YOUMU,"wuV_l̍דv",0,0,0,0,0);//XyJ[h\
	}
	@MainLoop
	{
		yield;
		SetCollisionA(GetX(),GetY(),24);//蔻(e)o^
		SetCollisionB(GetX(),GetY(),24);//蔻(̓)o^
	}
	@Finalize
	{
		loop(8)
		{
			CreateItem(ITEM_SCORE,cx+rand(-100,100),rand(20,100));
		}
	}
	@DrawLoop
	{
		SetTexture(imgExRumia);	
		SetGraphicRect(1,1,64,64);
		SetGraphicScale(1,1);
		SetGraphicAngle(0,0,0);
		SetAlpha(255);
		DrawGraphic(GetX,GetY);
	}
	@BackGround
	{
		SetTexture(forest);	
		SetGraphicRect(1,1,450,294);
		SetAlpha(255);
		SetGraphicScale(1.55,1.55);
		SetGraphicAngle(0,0,0);
		DrawGraphic(cx,cy);
		SetTexture(compus);	
		SetGraphicRect(1,1,750,720);
		SetAlpha(255);
		SetGraphicScale(0.5,0.5);
		SetGraphicAngle(0,0,count);
		DrawGraphic(cx,cy);
		count++;
	}
	task shottask
	{
		let s=0;
		wait(120);
		loop
		{
			shot(s,rand(GetClipMinX,GetClipMaxX),GetClipMaxY,2,270);
			shot(s,rand(GetClipMinX,GetClipMaxX),GetClipMinY,1,90);
			wait(4);
		}
	}
	task subtask
	{
		wait(120);
		loop
		{
			if(GetKeyState(VK_UP)==KEY_HOLD)
			{
				SetPlayerY(GetPlayerY-2);
			}
			else if(GetKeyState(VK_DOWN)==KEY_HOLD)
			{
				SetPlayerY(GetPlayerY-1);
			}
			yield;
		}
	}
	function shot(let shotid,let shotx,let shoty,let speed,let angle)
	{
		CreateShotA(shotid,shotx,shoty,0);
		SetShotDirectionType(ABSOLUTE);
		SetShotDataA(shotid,0,speed,angle,0,0,0,112);
		FireShot(shotid);
	}
	function wait(w) 
	{
		loop(w)
		{
			yield;
		}
	}
}