script_enemy_main{


    let imgEnemy ="script\DanMUku\Stage2\Image\WaruigiN.png";
    let z = 0;
    let w = 0.5;
    let pasTrois = true;
    let pasQuatre = true;

@Initialize{
    SetLife(1);
SetInvincibility(150);
    LoadGraphic(imgEnemy);
	SetMovePosition02(GetCenterX+100, GetCenterY, 60);

 }
@MainLoop{

	if (OnEvent){
		if (GetEventStep==3&&pasTrois) {
			SetMovePosition02(GetCenterX-100, GetCenterY, 60);
			pasTrois = false;
		}	
		if (GetEventStep==4&&pasQuatre) {
			SetMovePosition02(0, GetCenterY, 60);
			CreateItem(ITEM_BOMB, rand(GetX-10, GetX+10), rand(GetY-10, GetY+10));  
			CreateItem(ITEM_BOMB, rand(GetX-10, GetX+10), rand(GetY-10, GetY+10)); 
			pasQuatre = false;
		}
	}

	yield;


 }
@DrawLoop{
            SetColor(255,255,255);
            SetRenderState(ALPHA);
            SetAlpha(255);
            SetTexture(imgEnemy);
            SetGraphicRect(0, 0, 40, 40);
            DrawGraphic(GetX,GetY+z);

     if(z==10){w=-0.5;}
     if(z==-10){w=0.5;}
z+=w;

 }
@Finalize{
     DeleteGraphic(imgEnemy);
 }

}

