<?xml version="1.0" encoding="UTF-8"?>
<!--

If you're seeing this, it means your browser isn't capable of client side XSLT transformations.
You can't view this website correctly, sorry.

Please get a real browser like Firefox
    http://www.mozilla.com/firefox/

-->
<?xml-stylesheet type="text/xsl" href="xslt/site.xsl"?>

<page title="Rogue-Development.com" blogindex="true">
<replacedBy href="pulseParticles.html" />
    <navigation>
   		<page title="Home" page="index.xml" />
        <page title="Links" page="links.xml"/>
        <link title="Blog" url="http://marc-hughes.blogspot.com/index.html"/>
    </navigation>

    <content>
        


		<article heading="Pulse Particle System" type="html">
        <p>
        This is the early stages of a general purpose particle system for AS3 flash development.
        </p>
        </article>
        
      
        
		<article heading="Features" type="html">
        <p>
        <ul>
          <li>Configurable rule based particle behavior.</li>
          <li>Easily extensible</li>
          <li>Both a full featured object orientated syntax, and a simplified quick object syntax.</li>
        </ul>
        </p>
        </article>




        <article heading="Downloads" type="html">
        <p>
        <a href="http://code.google.com/p/pulse-particle/downloads/list">Download From Google Code</a>
        </p>
        </article>


        <article heading="Example Usage" type="html">
        <p>
        	The example below uses the simplified syntax for all of the effects, they can be seen here:
        	<pre name="code" class="actionscript">
		import com.roguedevelopment.pulse.simple.SimpleParticles;
		[Embed(source="snowflake.png")] 
		protected var snowflake:Class;
		
		[Embed(source="man.png")]
		protected var man:Class;

		[Embed(source="smoke.png")]
		protected var smoke:Class;

		[Embed(source="spark.png")]
		protected var spark:Class;
		
        	SimpleParticles.createEmitter({ image:snowflake , 
        		fade:[9000],
        		minScale:0.1, 
        		maxScale:1, 
        		minAngle:250, 
        		rotateToAngle:true, 
        		maxAngle:290, 
        		pps:10, 
        		gravity:3, 
        		maxSpeed: 105, 
        		minSpeed:60, 
        		lifespan:9000,  
        		x:250, y:300, movement:true });
        													
			SimpleParticles.createEmitter({ image:spark ,   
				fade:[6000], 
				scale:[4000,0.01,1], 
				minAngle:210, 
				maxAngle:330, 
				pps:55, gravity:5, 
				maxSpeed: 140, minSpeed:80, 
				lifespan:6000,  x:250, y:240, 
				movement:true });
				
			SimpleParticles.createEmitter({ image:smoke , 
				xOscillate:[1,900], rotate:[-2,2], 
				fade:[6000],
				minScale:0.5, maxScale:1, 
				minAngle:180, maxAngle:360, 
				pps:35, gravity:-1.5, 
				maxSpeed: 13, minSpeed:4, 
				lifespan:6000,  
				x:250, y:300, movement:true });	
											
			SimpleParticles.createEmitter({ minScale:0.01, maxScale:3, 
				x:250, y:200, 
				pps:80, lifespan:1000, 
				movement:true, minAngle:0, 
				maxAngle:360} );
				
			SimpleParticles.createEmitter({ x:250, y:200, 
				rotateToAngle:true, line:true, 
				size:4, lifespan:4000, 
				movement:true, mouseSwarm:stage});
				
			SimpleParticles.createEmitter({ image:man , pps:50, 
				pointSwarm:new Point(1000,700), 
				rotateToAngle:true, maxSpeed: 110, 
				minSpeed:100, scale:[5000, 0.05,1 ], 
				lifespan:6500,  
				x:20, y:20, movement:true });
					
			</pre>							
		</p>
		
		
			<link type="text/css" rel="stylesheet" href="dp.SyntaxHighlighter/Styles/SyntaxHighlighter.css"></link>
			<script language="javascript" src="dp.SyntaxHighlighter/Scripts/shCore.js"></script>
			<script language="javascript" src="dp.SyntaxHighlighter/Scripts/shBrushAS3.js"></script>
			<script language="javascript" src="dp.SyntaxHighlighter/Scripts/shBrushXml.js"></script>
			<script language="javascript">
			// <![CDATA[
			window.onload = function () {
			dp.SyntaxHighlighter.ClipboardSwf = 'dp.SyntaxHighlighter/Scripts/clipboard.swf';
			dp.SyntaxHighlighter.HighlightAll('code');
			}
			// ]]>
			</script>
        </article> 

        <article heading="Example" type="html" >
        <p>
       

		Click the example to manually cycle.
		</p>
        	<script type="text/javascript" src="swfobject/swfobject.js"></script>
        	<div id="flashcontent">
				<strong>You need to upgrade your Flash Player</strong>		
			</div>

			<script type="text/javascript">
				// <![CDATA[
				
				var so = new SWFObject("pulse/Flinger.swf", "pulse/Flinger.swf", "500", "350", "9", "#000000");
				so.write("flashcontent");
				
				// ]]>
			</script>
        </article>
        
        <article heading="Particle Explorer" type="html">
        <p>
        Click image to play.
       	 <a href="http://rogue-development.com/pulse/explorer/#"><img style="float:none;"  src="http://www.rogue-development.com/blog/uploaded_images/-example-738831" alt="" border="0" /></a>
       	</p> 
       	<p>
       	 <ol>
       	 	<li>Various configuration options for the particles</li>
       	 	<li>The resulting config-object that those options make, you can pass that to SimpleParticles to create the effect in your application.</li>
			<li>A live preview of the particle effect</li>
		</ol>
		The demo only has a handful of rules in it, but they show off a good chunk of the possible functionality you can get from the SimpleParticles interface. One of the biggest limitations of the explorer is there's only a few images embedded for you to make particles out of. 

To use one of these particles in your app, do something like this:
		<pre  name="code" class="actionscript">
		import com.roguedevelopment.pulse.simple.SimpleParticles;
import com.roguedevelopment.pulse.PulseEngine;

...

PulseEngine.instance.root = this;
SimpleParticles.createEmitter( {pps:10,x:153, y:286,image:spark, 
    movement:true, minSpeed:199, 
    maxSpeed:216, minAngle:211, 
    maxAngle:219, minScale:0.8, 
    maxScale:1, pointSwarm:[100,100], lifespan:5000} );
    </pre>

		</p>
        </article>



		<article heading="License" type="html">
		<p>
		This component is licensed under the MIT license.
		</p>
        <p>
        Copyright (c) 2007 Marc Hughes
		</p>
		<p>
		Permission is hereby granted, free of charge, to any person
		obtaining a copy of this software and associated documentation
		files (the "Software"), to deal in the Software without
		restriction, including without limitation the rights to use,
		copy, modify, merge, publish, distribute, sublicense, and/or sell
		copies of the Software, and to permit persons to whom the
		Software is furnished to do so, subject to the following
		conditions:
		</p>
		<p>
		The above copyright notice and this permission notice shall be
		included in all copies or substantial portions of the Software.
		</p>
		<p>
		THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
		EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
		OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
		NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
		HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
		WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
		FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
		OTHER DEALINGS IN THE SOFTWARE.
        </p>
        </article>


    </content>

</page>
