script_enemy_main
{    
    let imgEnemy="script\DanMUku\Stage1\Image\ParagoombaB.png";
    let count=-100;
    let a=0;
    let b=40;
    let angle=GetAngle;
    let player = 0;
    let tir ="script\DanMUku\Stage1\Son\tir.wav";
   @Initialize
   {
      LoadGraphic(imgEnemy);
      LoadSE(tir);
            SetLife(300); 
   }
   
   @MainLoop
   {
          SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
if(count%10==0)
{
if(a==120)
{
a=0;
b=40;
}
else
{
a+=40;
b+=40;
}
}
if(count==50)
{
SetSpeed(0);
PlaySE(tir);
player = GetAngleToPlayer-50;
loop(5)
{
CreateShot01(GetX, GetY, 2, player, BLUE01, 0);
player+=20;
}
}
if(count==200&&angle<=90)
{
SetSpeed(1);
SetAngle(angle+90);
}
if(count==300&&angle>90)
{
SetSpeed(1);
SetAngle(angle-90);
}
angle=GetAngle;
count++;
   }
   @Finalize
   {
CreateItem(ITEM_SCORE, rand(GetX-10, GetX+10), rand(GetY-10, GetY+10));  
CreateItem(ITEM_SCORE, rand(GetX-10, GetX+10), rand(GetY-10, GetY+10));  
	if (GetX>0&&GetY>0&&GetX<448&&GetY<480&&GetCommonData("goomba")>=0) {
		SetCommonData("goomba", GetCommonData("goomba")+1);
		if (GetCommonData("goomba")==50) {
			SetCommonData("N", true);
		}
	}
}
   
   @DrawLoop
   {
            SetColor(255,255,255);
            SetRenderState(ALPHA);
            SetTexture(imgEnemy);
            SetGraphicRect(a, 0, b, 40);
            DrawGraphic(GetX,GetY);
   }
}
