
task Concentration(tobj, TYPE, DIST, loopcount, RB, RC, GB, GC, BB, BC){
	loop(loopcount){
		let X = ObjMove_GetX(tobj);
		let Y = ObjMove_GetY(tobj);
		let ANGLE = rand(0, 360);
		let SCALE = 0.4;
		let DIST1 = 0;
		let graphic;
		let ANGLE1 = 0;
		let TYPE_NOTE = "NOTE";
		let graphicx=0;
		let graphicy=0;
		let TYPE_STAR= "STAR";
		let TYPE_SNOW= "SNOW";

		
		if(TYPE==TYPE_NOTE){
			graphic=GetCurrentScriptDirectory ~ "note.png";
			ANGLE1 = rand(-10, 10);
			graphicx = 128;
			graphicy = 128;
			}
			
		if(TYPE==TYPE_STAR){
			graphic=GetCurrentScriptDirectory ~ "star.png";
			ANGLE1 = rand(0, 360);
			graphicx = 128;
			graphicy = 128;
			}
		
		if(TYPE==TYPE_SNOW){
			graphic=GetCurrentScriptDirectory ~ "snow.png";
			ANGLE1 = rand(0, 360);
			graphicx = 128;
			graphicy = 128;
			SCALE=0.3;
			}
		
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		ObjPrim_SetTexture(obj, graphic);
		Obj_SetRenderPriorityI(obj,22);
		ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
		ObjRender_SetAlpha(obj,230);
		ObjSprite2D_SetSourceRect(obj,0,0,graphicx, graphicy);
		ObjSprite2D_SetDestCenter(obj);
		ObjRender_SetPosition(obj, X+DIST+rand(-5, 5)*cos(ANGLE),Y+DIST+rand(-5, 5)*sin(angle),0);
		ObjRender_SetScaleXYZ(obj, SCALE, SCALE, 0);		
		ObjRender_SetAngleXYZ(obj,0, 0, ANGLE1);
		ObjRender_SetColor(obj, rand(RB, RC), rand(GB, GC), rand(BB, BC));

		SHRINK(obj, SCALE);
		MOVE(obj, X, Y, DIST, ANGLE, 0);
		
		task SHRINK(TOBJ, MOD){
			while(!Obj_IsDeleted(TOBJ)){
			
			ObjRender_SetScaleXYZ(TOBJ, MOD, MOD, 0);
			
			if(MOD>0){
				MOD-=0.005;
				}
				
			if(MOD<=0){
				Obj_Delete(TOBJ);
				}
			
			yield;
			}
			}
			
		task MOVE(TOBJ1, XMOD, YMOD, MOD1, ANGLEMOD, MODCAP){
			while(!Obj_IsDeleted(TOBJ1)){
				ObjRender_SetPosition(TOBJ1, XMOD+MOD1*cos(ANGLEMOD), YMOD+MOD1*sin(ANGLEMOD), 0);
				
				if(MOD1>MODCAP){
					MOD1-=1;
					}
				yield;
				}
				
			}
			
		yield;
		}
	}
	
task BulletConcentration(xposition, yposition, TYPE, DIST, loopcount, RB, RC, GB, GC, BB, BC){
	loop(loopcount){
		let X = xposition;
		let Y = yposition;
		let ANGLE = rand(0, 360);
		let SCALE = 0.4;
		let DIST1 = 0;
		let graphic;
		let ANGLE1 = 0;
		let TYPE_NOTE = "NOTE";
		let graphicx=0;
		let graphicy=0;
		let TYPE_STAR= "STAR";
		let TYPE_SNOW= "SNOW";
		
		
		if(TYPE==TYPE_NOTE){
			graphic=GetCurrentScriptDirectory ~ "note.png";
			ANGLE1 = rand(-10, 10);
			graphicx = 128;
			graphicy = 128;
			}
			
		if(TYPE==TYPE_STAR){
			graphic=GetCurrentScriptDirectory ~ "star.png";
			ANGLE1 = rand(0, 360);
			graphicx = 128;
			graphicy = 128;
			}
			
		if(TYPE==TYPE_SNOW){
			graphic=GetCurrentScriptDirectory ~ "snow.png";
			ANGLE1 = rand(0, 360);
			graphicx = 128;
			graphicy = 128;
			SCALE=0.3;
			}
			
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		ObjPrim_SetTexture(obj, graphic);
		Obj_SetRenderPriorityI(obj,22);
		ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
		ObjRender_SetAlpha(obj,230);
		ObjSprite2D_SetSourceRect(obj,0,0,graphicx, graphicy);
		ObjSprite2D_SetDestCenter(obj);
		ObjRender_SetPosition(obj, X+DIST+rand(-5, 5)*cos(ANGLE),Y+DIST+rand(-5, 5)*sin(angle),0);
		ObjRender_SetScaleXYZ(obj, SCALE, SCALE, 0);		
		ObjRender_SetAngleXYZ(obj,0, 0, ANGLE1);
		ObjRender_SetColor(obj, rand(RB, RC), rand(GB, GC), rand(BB, BC));

		SHRINK(obj, SCALE);
		MOVE(obj, X, Y, DIST, ANGLE, 0);
		
		task SHRINK(TOBJ, MOD){
			while(!Obj_IsDeleted(TOBJ)){
			ObjRender_SetScaleXYZ(TOBJ, MOD, MOD, 0);
			
			if(MOD>0){
				MOD-=0.005;
				}
				
			if(MOD<=0){
				Obj_Delete(TOBJ);
				}
			
			yield;
			}
			}
			
		task MOVE(TOBJ1, XMOD, YMOD, MOD1, ANGLEMOD, MODCAP){
			while(!Obj_IsDeleted(TOBJ1)){
				ObjRender_SetPosition(TOBJ1, XMOD+MOD1*cos(ANGLEMOD), YMOD+MOD1*sin(ANGLEMOD), 0);
				
				if(MOD1>MODCAP){
					MOD1-=1;
					}
				yield;
				}
			}
			
		yield;
		}
	}