
//======================================
//リソース読み込み、グラフィックレクトなど
//
//======================================

let img_Enemy = GetCurrentScriptDirectory() ~ "img\rock_kaname_lb.png";
let img_EnemyBoss = GetCurrentScriptDirectory() ~ "img\tenshi.png";
let img_Burst = GetCurrentScriptDirectory() ~ "img\circle_fire.png";
let img_Text = GetCurrentScriptDirectory() ~ "img\text2.png";
let img_Spell = GetCurrentScriptDirectory() ~ "img\spell.png";


let se_Hit = GetCurrentScriptDirectory() ~ "se\hit_p03_c.wav";
let se_Create = GetCurrentScriptDirectory() ~ "se\pyoro36.wav";
let se_Fall =  GetCurrentScriptDirectory() ~ "se\swing41.wav";
let se_Laser =  GetCurrentScriptDirectory() ~ "se\gun10.wav";
let se_RockHit =  GetCurrentScriptDirectory() ~ "se\bom20_a.wav";


function system_SetEnemyTexture(let type){

	alternative(type)

	case("KANAME"){
		img_Enemy = GetCurrentScriptDirectory() ~ "img\rock_kaname_l.png";
	}
	case("KANAME_B"){
		img_Enemy = GetCurrentScriptDirectory() ~ "img\rock_kaname_lb.png";
	}
	case("ROCK"){
		img_Enemy = GetCurrentScriptDirectory() ~ "img\rock_l.png";
	}
	case("ROCK_B"){
		img_Enemy = GetCurrentScriptDirectory() ~ "img\rock_lb.png";
	}


	return;
}//end function


function once_system_LoadResource(){
	//ClearRenderTarget(img_render_Circle);

	LoadGraphic(img_Enemy);
	LoadGraphic(img_Burst);

	LoadSE(se_Hit);
	return;

}//end function

function once_system_LoadResourceBoss(){
	//ClearRenderTarget(img_render_Circle);

	LoadGraphic(img_Enemy);
	LoadGraphic(img_EnemyBoss);
	LoadGraphic(img_Burst);
	LoadGraphic(img_Text);
	LoadGraphic(img_Spell);

	LoadSE(se_Hit);
	LoadSE(se_Create);
	LoadSE(se_Fall);
	LoadSE(se_Laser);
	LoadSE(se_RockHit);
	return;

}//end function

function once_system_DeleteResource(){

	DeleteGraphic(img_Enemy);
	DeleteGraphic(img_Burst);
	DeleteSE(se_Hit);

}//end function

function once_system_DeleteResourceBoss(){

	DeleteGraphic(img_Enemy);
	DeleteGraphic(img_EnemyBoss);
	DeleteGraphic(img_Burst);
	DeleteGraphic(img_Text);
	DeleteSE(se_Hit);

}//end function

function system_SetGraphicRect(let type){

	let rect = system_GetGraphicRect(type);
	SetGraphicRect( rect[0], rect[1], rect[2], rect[3] );
	return;

}//end function


function system_GetGraphicRect(let type){

	alternative(type)
	case("BOSS_MAIN01"){return [32*0, 32*0, 32*1, 32*2];}
	case("BOSS_MAIN02"){return [32*1, 32*0, 32*2, 32*2];}
	case("BOSS_MAIN03"){return [32*2, 32*0, 32*3, 32*2];}
	case("BOSS_MAIN04"){return [32*3, 32*0, 32*4, 32*2];}
	case("BOSS_RIGHT01"){return [32*0, 32*2, 32*1, 32*4];}
	case("BOSS_RIGHT02"){return [32*1, 32*2, 32*2, 32*4];}
	case("BOSS_LEFT01"){return [32*2, 32*2, 32*3, 32*4];}
	case("BOSS_LEFT02"){return [32*3, 32*2, 32*4, 32*4];}
	case("BOSS_CONC01"){return [32*5, 32*0, 32*6, 32*2];}
	case("BOSS_JUMP01"){return [32*0, 32*4, 32*1, 32*6];}
	case("BOSS_JUMP02"){return [32*1, 32*4, 32*2, 32*6];}
	case("BOSS_JUMP03"){return [32*2, 32*4, 32*3, 32*6];}

	case("ROCK_MAIN01"){return [32*0, 32*0, 32*2, 32*2];}
	case("ROCK_MAIN02"){return [32*2, 32*0, 32*4, 32*2];}
	case("ROCK_MAIN03"){return [32*4, 32*0, 32*6, 32*2];}
	case("ROCK_MAIN04"){return [32*6, 32*0, 32*8, 32*2];}

	case("BURST_01"){return [32*0, 32*0, 32*4, 32*4];}
	case("BURST_02"){return [32*4, 32*0, 32*8, 32*4];}
	case("BURST_03"){return [32*8, 32*0, 32*12, 32*4];}
	case("BURST_04"){return [32*12, 32*0, 32*16, 32*4];}
	case("BURST_05"){return [32*0, 32*4, 32*4, 32*8];}
	case("BURST_06"){return [32*4, 32*4, 32*8, 32*8];}
	case("BURST_07"){return [32*8, 32*4, 32*12, 32*8];}
	case("BURST_08"){return [32*12, 32*4, 32*16, 32*8];}

	case("DANGER"){return [32*0, 32*1, 32*4, 32*2];}
	case("SPELL"){return [32*0, 32*0, 32*8, 32*2];}

	return [0,0,0,0];

}//end function


