<ps>
	<emit>
		<main res = "assets/levels/common/fx/sparkle">
			<bornpart>
				local q = ObjGet();

				local h = -Random( q.inputrect_w / 3, q.inputrect_w / 2 );
				local x = Random( 0, q.inputrect_w ) - q.inputrect_w / 2;
				local ang = Random( 0.0, 6.0 );
				local sc = Random( 0.5, 0.8 );
				
				Animate( ne_angle, { 0,ang, 100,ang } );
				
				Animate( ne_pos_x, { 0,x, 100,x } );
				Animate( ne_pos_y, { 0,q.inputrect_h/2, 100,h } );
				
				Animate( ne_scale_x, { 0,0, 10,0.8*sc, 20,0, 30,0.5*sc, 40,1.0*sc, 50,0.8*sc, 60,0.5*sc,
				70,1.0*sc, 80,0.5*sc, 90,0.7*sc, 100, 0 } );
				Animate( ne_scale_y, { 0,0, 10,0.8*sc, 20,0, 30,0.5*sc, 40,1.0*sc, 50,0.8*sc, 60,0.5*sc, 
				70,1.0*sc, 80,0.5*sc, 90,0.7*sc, 100, 0 } );
				
				DieAfter( -h / 30.0 );
			</bornpart>
			<diepart>
			</diepart>
			<processpart>
				if( Random( 0, 1.0 ) > 0.7 ) then
					CreateEmitter( "slave", 0, 0 );
				end
			</processpart>
			<process>
				local q = ObjGet();
				CreateParticles( q.inputrect_w * q.inputrect_h * ps_dt / 10000 * 2 );
			</process>
		</main>
		<slave res = "assets/levels/common/fx/sparkle">
			<bornpart>
				local sc = Random( 0.1, 0.2 );
				local x = Random( -2.0, 2.0 );
				
				Animate( ne_scale_x, { 0,sc, 100,sc } );
				Animate( ne_scale_y, { 0,sc, 100,sc } );
			
				Animate( ne_alpha, { 0,0, 10,1.0, 20,0, 30,0, 40,1.0, 50,0, 60,1.0, 100, 0 } );
								
				Animate( ne_pos_x, { 0,x, 100,x } );
				Animate( ne_pos_y, { 0,0, 100,Random( 1.0, 5.0 ) } );
				
				DieAfter( Random( 0, 0.5 ) );
			</bornpart>
			<diepart>
			</diepart>
			<process>
				CreateParticles( 2 );
				DeleteMe();
			</process>
		</slave>
	</emit>
	<process>
		if( ps_state == 0 ) then
			CreateEmitter( "main", 0, 0 );
			ps_state = 1;
		end
	</process>
</ps>
