let Stage1_Back1_y = 0;
let Stage1_Back2_y = 0;

/**
 * 攚宨昤夋張棟
 */
function GameBackGround(){
	//攚宨昤夋僆儞帪偺傒昤夋
	if( GetIsDrawBackGround() ){
		alternative( State )
			case( State_Stage1_First, State_Stage1_MidBoss, State_Stage1_Latter, State_Stage1_Boss ){
				//僗僥乕僕1攚宨
				Stage1BackGround();
			}
			case( State_Stage2_First, State_Stage2_MidBoss, State_Stage2_Latter, State_Stage2_Boss ){
				//僗僥乕僕2攚宨
				Stage2BackGround();
			}
			case( State_Stage3_First, State_Stage3_MidBoss, State_Stage3_Latter, State_Stage3_Boss ){
				//僗僥乕僕3攚宨
				Stage3BackGround();
			}
			case( State_StageEX_First, State_StageEX_MidBoss, State_StageEX_Latter, State_StageEX_Boss ){
				//僗僥乕僕EX攚宨
				StageEXBackGround();
			}
	}
}

/**
 * 攚宨昤夋僐儞僩儘乕儖僞僗僋
 */
task BackGroundControl(){
	loop{
		alternative( State )
			case( State_Stage1_First, State_Stage1_MidBoss, State_Stage1_Latter, State_Stage1_Boss ){
				Stage1_Back1_y += 8.8;
				if( Stage1_Back1_y > 1024 ){
					Stage1_Back1_y -= 1024;
				}
				Stage1_Back2_y += 1.6;
				if( Stage1_Back2_y > 512 ){
					Stage1_Back2_y -= 512;
				}
			}
		
		yield;
	}
}

/**
 * 僗僥乕僕1攚宨
 */
function Stage1BackGround(){
	SetPerspectiveClip( 0, 1500 );
	SetFog( -200, 700, 198, 198, 198 );
	
	SetTexture( imgBack_Stage1_1 );
	SetGraphicRect( 0, Stage1_Back1_y, 1024, 1024 + Stage1_Back1_y );
	SetGraphicScale( 1, 1 );
	SetColor( 216, 216, 255 );
	SetAlpha( 255 );
	SetGraphicAngle( -90, 0, 0 );
	DrawGraphic3D( 0, 0, 0 );
	
	SetTexture( imgDummy );
	SetGraphicRect( 0, 0, 32, 32 );
	SetGraphicScale( 32, 32 );
	SetColor( 1, 1, 1 );
	SetAlpha( 128 );
	SetGraphicAngle( -90, 0, 0 );
	DrawGraphic3D( 0, 0, 0 );
	
	SetTexture( imgBack_Stage1_2 );
	SetGraphicRect( 0, Stage1_Back2_y, 512, 512 + Stage1_Back2_y );
	SetGraphicScale( 1.6, 1.6 );
	SetColor( 255, 255, 255 );
	SetAlpha( 128 );
	SetGraphicAngle( -90, 0, 0 );
	DrawGraphic3D( 0, 0, 0 );
}

/**
 * 僗僥乕僕2攚宨
 */
function Stage2BackGround(){
}

/**
 * 僗僥乕僕3攚宨
 */
function Stage3BackGround(){
}

/**
 * 僗僥乕僕EX攚宨
 */
function StageEXBackGround(){
}
