script_enemy_main {
		
	let frame = 0;
	let CSD = GetCurrentScriptDirectory;
	let imgBoss = CSD ~ "mamizou.png";
	let x = 0;	
	let f = 0;
	let f2 = 0;
	let dir = 216;
	let r = 80;
	let trans = 255;

	@Initialize{
		SetLife(1500);
		SetInvincibility(480);
		SetDamageRate(100,0);
		LoadGraphic(imgBoss);
		mainTask;
	}
	@MainLoop{
		if(OnBomb == false){
		SetCollisionA(GetX,GetY,32);
		SetCollisionB(GetX,GetY,16);
		trans=255;
		}
		if(OnBomb == true){trans=50;}
		yield;
	}
	@DrawLoop{
		SetTexture(imgBoss);
		SetRenderState(ALPHA);
		SetAlpha(trans);
		SetGraphicScale(1,1);
		SetGraphicAngle(0,0,0);
		
		if(f<5){SetGraphicRect(0,256,32,288);}
		if(f>=5 && f<10){SetGraphicRect(32,256,64,288);}
		if(f>=10 && f<15){SetGraphicRect(64,256,96,288);}
				
		f++;
		if(f==15){f=0;}
		
		DrawGraphic(GetX,GetY);
	}
	@Finalize{
		//DeleteGraphic(imgBoss);
	}
	
	task mainTask{
		yield;
		movement;
	}
	
	task movement{		
		loop{
			SetMovePosition01(GetEnemyX+r*cos(dir),GetEnemyY+r*sin(dir),3);
			dir++;
			yield;
		}
	}
		
	function wait(w){
		loop(w){yield;}
	}
	
}