//“Œ•û’e–‹•—
//enemy01
#ScriptVersion[2]

script_enemy_main{

#include_function".\lib\include_std.txt"
#include_function".\system\include_enemy_child.txt"

let animation_counter = 0;

@Initialize{

	SetDamageRate(100,100);
	system_SetEnemyTexture("ROCK");
	system_SetEnemyType(1);
	once_system_LoadResource();
	system_SetEnemyLife(10);
	system_SetEnemyWeight(1);
	system_SetEnemyRadius(8);
	once_MainRoutine();
}

@MainLoop{
	SetCollisionA(GetX(), GetY(), 12);
	animation_counter++;
	yield;
}

@DrawLoop{
	if(system_IsInvisible()){return;}
	SetTexture(img_Enemy);
	SetGraphicScale(0.4, 0.4);
	system_SetGraphicRect(["ROCK_MAIN01","ROCK_MAIN02","ROCK_MAIN03","ROCK_MAIN04"][trunc(animation_counter/4)%4]);
	DrawGraphic(GetX(), GetY());
}

@Finalize{

}


task once_MainRoutine(){
	once_system_TaskSphereParameterChecker();
	once_system_TaskSphereHitTest();
	once_system_EnemyMain();
	once_MoveRoutine();
}

task once_MoveRoutine(){
	system_MoveTypeSelect();
	system_StartMove();

}


}

