	SetCameraFocusX(0);
	SetCameraFocusY(-120);
	SetCameraFocusZ(100);
	SetCameraRadius(700);
    SetCameraElevationAngle(0);
	SetCameraAzimuthAngle(89);
	SetFogParam(500, 1750, 1, 1, 25);
	SetCameraPerspectiveClip(10, 4000);
	
task StageBackground{
let a = 0;

let obj = ObjPrim_Create(OBJ_SPRITE_3D);

ObjPrim_SetTexture(obj, GetCurrentScriptDirectory ~ "./img/Ingame/stg3bg1.png");
Obj_SetRenderPriorityI(obj,20);
ObjRender_SetAngleX(obj,-50);
ObjRender_SetScaleXYZ(obj,1,1,1.5);
ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
ObjRender_SetAlpha(obj, 188);
ObjRender_SetPosition(obj, 0, 0, -200);

Cherry;
Cherry2;
Cherry3;


	loop{
	ObjSprite3D_SetSourceDestRect(obj,0,-256*2+(a),256*4,256*5+a);
	a++;
	yield;
	}
	
task Cherry{
let a = 0;

let obj = ObjPrim_Create(OBJ_SPRITE_3D);
let obj2 = ObjPrim_Create(OBJ_SPRITE_3D);

ObjPrim_SetTexture(obj, GetCurrentScriptDirectory ~ "./img/Ingame/stg3bg2.png");
Obj_SetRenderPriorityI(obj,20);
ObjRender_SetAngleX(obj,-50);
ObjRender_SetScaleXYZ(obj,1,1,1.5);
ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
ObjRender_SetAlpha(obj, 188);
ObjRender_SetPosition(obj, -250, 0, -100);

ObjPrim_SetTexture(obj2, GetCurrentScriptDirectory ~ "./img/Ingame/stg3bg2.png");
Obj_SetRenderPriorityI(obj2,20);
ObjRender_SetAngleX(obj2,-50);
ObjRender_SetAngleZ(obj2,180);
ObjRender_SetScaleXYZ(obj2,1,1,1.5);
ObjRender_SetBlendType(obj2,BLEND_ADD_ARGB);
ObjRender_SetAlpha(obj2, 188);
ObjRender_SetPosition(obj2, 250, 0, -100);


	loop{
	ObjSprite3D_SetSourceDestRect(obj,0,-1024+(a),512,1024+a);
	ObjSprite3D_SetSourceDestRect(obj2,0,-1024-(a),512,1024-a);
	a++;
	yield;
	}
}
task Cherry2{
let a = 0;

let obj = ObjPrim_Create(OBJ_SPRITE_3D);
let obj2 = ObjPrim_Create(OBJ_SPRITE_3D);

ObjPrim_SetTexture(obj, GetCurrentScriptDirectory ~ "./img/Ingame/stg3bg3.png");
Obj_SetRenderPriorityI(obj,20);
ObjRender_SetAngleX(obj,-50);
ObjRender_SetScaleXYZ(obj,1,1,1.5);
ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
ObjRender_SetAlpha(obj, 188);
ObjRender_SetPosition(obj, -250, 0, -66);

ObjPrim_SetTexture(obj2, GetCurrentScriptDirectory ~ "./img/Ingame/stg3bg3.png");
Obj_SetRenderPriorityI(obj2,20);
ObjRender_SetAngleX(obj2,-50);
ObjRender_SetAngleZ(obj2,180);
ObjRender_SetScaleXYZ(obj2,1,1,1.5);
ObjRender_SetBlendType(obj2,BLEND_ADD_ARGB);
ObjRender_SetAlpha(obj2, 188);
ObjRender_SetPosition(obj2, 250, 0, -66);


	loop{
	ObjSprite3D_SetSourceDestRect(obj,0,-1024+(a*1.5),512,1024+a*1.5);
	ObjSprite3D_SetSourceDestRect(obj2,0,-1024-(a*1.5),512,1024-a*1.5);
	a++;
	yield;
	}
}
task Cherry3{
let a = 0;

let obj = ObjPrim_Create(OBJ_SPRITE_3D);
let obj2 = ObjPrim_Create(OBJ_SPRITE_3D);

ObjPrim_SetTexture(obj, GetCurrentScriptDirectory ~ "./img/Ingame/stg3bg4.png");
Obj_SetRenderPriorityI(obj,20);
ObjRender_SetAngleX(obj,-50);
ObjRender_SetScaleXYZ(obj,1,1,1.5);
ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
ObjRender_SetAlpha(obj, 188);
ObjRender_SetPosition(obj, -250, 0, -33);

ObjPrim_SetTexture(obj2, GetCurrentScriptDirectory ~ "./img/Ingame/stg3bg4.png");
Obj_SetRenderPriorityI(obj2,20);
ObjRender_SetAngleX(obj2,-50);
ObjRender_SetAngleZ(obj2,180);
ObjRender_SetScaleXYZ(obj2,1,1,1.5);
ObjRender_SetBlendType(obj2,BLEND_ADD_ARGB);
ObjRender_SetAlpha(obj2, 188);
ObjRender_SetPosition(obj2, 250, 0, -33);


	loop{
	ObjSprite3D_SetSourceDestRect(obj,0,-1024+(a*2),512,1024+a*2);
	ObjSprite3D_SetSourceDestRect(obj2,0,-1024-(a*2),512,1024-a*2);
	a++;
	yield;
	}
}
}

task Background{
	let count = 0;
	let obj=ObjPrim_Create(OBJ_SPRITE_2D);
	
	Obj_SetRenderPriorityI(obj,20);
	ObjPrim_SetTexture(obj,GetCurrentScriptDirectory ~ "/img/Ingame/back1.png");
	ObjSprite2D_SetSourceRect(obj,0,0,512,512);
	ObjSprite2D_SetDestCenter(obj);
	ObjRender_SetScaleXYZ(obj, 2, 2, 1);
	ObjRender_SetBlendType(obj,BLEND_ALPHA);
	ObjRender_SetPosition(obj,GetStgFrameWidth/2, GetStgFrameHeight/2,0);
	loop{
	ObjSprite2D_SetSourceRect(obj,0,0+count/7,512*2,512*2+count/7);
	ObjRender_SetAlpha(obj, count*5);
	count++;
	yield;
	}
	Obj_Delete(obj);

}

task Background2{
	let count = 0;
	let alpha = 0;
	let obj=ObjPrim_Create(OBJ_SPRITE_2D);
	Obj_SetRenderPriorityI(obj,20);
	ObjPrim_SetTexture(obj,GetCurrentScriptDirectory ~ "/img/Ingame/back2.png");
	ObjSprite2D_SetSourceRect(obj,0,0,512,512);
	ObjSprite2D_SetDestCenter(obj);
	ObjRender_SetScaleXYZ(obj, 2, 2, 1);
	ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
	ObjRender_SetPosition(obj,GetStgFrameWidth/2, GetStgFrameHeight/2,0);
	loop{
	ObjSprite2D_SetSourceRect(obj,0+count/6,0-count/6,512*2+count/6,512*2-count/6);
	ObjRender_SetAlpha(obj, alpha*5);
	if(alpha<25){alpha++;}
	count++;
	yield;
	}
	Obj_Delete(obj);

}

