Flint Particle System Forum - Let's take a shower 2010-12-25T16:36:41+00:00 http://flintparticles.org/forum/ Lussumo Vanilla & Feed Publisher Let's take a shower http://flintparticles.org/forum/comments.php?DiscussionID=4&Focus=4#Comment_4 2008-02-23T13:36:54+00:00 2008-05-20T10:10:03+01:00 sandersnake http://flintparticles.org/forum/account.php?u=4 Tried to simulate a shower. That dirty piggy needs to be cleaned. Check the result at http://www.actionscripter.nl/flash/regendouche.html Source Code: import flash.geom.Point; import ... That dirty piggy needs to be cleaned.

Check the result at http://www.actionscripter.nl/flash/regendouche.html

Source Code:

import flash.geom.Point;
import org.flintparticles.actions.*;
import org.flintparticles.counters.*;
import org.flintparticles.displayObjects.*;
import org.flintparticles.emitters.*;
import org.flintparticles.initializers.*;
import org.flintparticles.zones.*;

import com.afcomponents.common.display.*;
import com.afcomponents.common.graphics.*;

var emitter:DisplayObjectEmitter = new DisplayObjectEmitter();

emitter.setCounter( new Steady( 350 ) );
emitter.addInitializer( new ImageClass( Dot, 1 ) );
var dz:DiscZone = new DiscZone( new Point( 225, 120 ), 60, 0 );
emitter.addInitializer( new Position( dz ) );
emitter.addInitializer( new Velocity( new PointZone( new Point( 0, 200 ) ) ) );
emitter.addInitializer( new Lifetime( 1.5, 1.5 ) );
emitter.addAction( new Move() );
emitter.addAction( new Accelerate(0, 200) );
emitter.addAction( new RandomDrift( 100, 0 ) );
emitter.addAction( new Age() );
emitter.addAction( new Fade() );
emitter.addAction( new DeathOffStage () );

addChild( emitter );
emitter.start();
emitter.runAhead( 0 );
]]>
Let's take a shower http://flintparticles.org/forum/comments.php?DiscussionID=4&Focus=6#Comment_6 2008-02-23T14:58:20+00:00 2008-02-23T14:59:49+00:00 Richard http://flintparticles.org/forum/account.php?u=1 You might like to try a set of fixed points to emit the particles from to simulate the holes in the shower head. Something like this (you could also devise an algorithm to create the points rather ...
import flash.geom.Point;
import org.flintparticles.actions.*;
import org.flintparticles.counters.*;
import org.flintparticles.displayObjects.*;
import org.flintparticles.emitters.*;
import org.flintparticles.initializers.*;
import org.flintparticles.zones.*;

var emitter:DisplayObjectEmitter = new DisplayObjectEmitter();

emitter.setCounter( new Steady( 350 ) );
emitter.addInitializer( new ImageClass( Dot, 1 ) );
var mz:MultiZone = new MultiZone();
mz.addZone( new PointZone( new Point( 208, 100 ) ) );
mz.addZone( new PointZone( new Point( 228, 100 ) ) );
mz.addZone( new PointZone( new Point( 248, 100 ) ) );
mz.addZone( new PointZone( new Point( 176, 110 ) ) );
mz.addZone( new PointZone( new Point( 196, 110 ) ) );
mz.addZone( new PointZone( new Point( 216, 110 ) ) );
mz.addZone( new PointZone( new Point( 236, 110 ) ) );
mz.addZone( new PointZone( new Point( 256, 110 ) ) );
mz.addZone( new PointZone( new Point( 276, 110 ) ) );
mz.addZone( new PointZone( new Point( 165, 120 ) ) );
mz.addZone( new PointZone( new Point( 185, 120 ) ) );
mz.addZone( new PointZone( new Point( 205, 120 ) ) );
mz.addZone( new PointZone( new Point( 225, 120 ) ) );
mz.addZone( new PointZone( new Point( 245, 120 ) ) );
mz.addZone( new PointZone( new Point( 265, 120 ) ) );
mz.addZone( new PointZone( new Point( 285, 120 ) ) );
mz.addZone( new PointZone( new Point( 174, 130 ) ) );
mz.addZone( new PointZone( new Point( 194, 130 ) ) );
mz.addZone( new PointZone( new Point( 214, 130 ) ) );
mz.addZone( new PointZone( new Point( 234, 130 ) ) );
mz.addZone( new PointZone( new Point( 254, 130 ) ) );
mz.addZone( new PointZone( new Point( 274, 130 ) ) );
mz.addZone( new PointZone( new Point( 202, 140 ) ) );
mz.addZone( new PointZone( new Point( 222, 140 ) ) );
mz.addZone( new PointZone( new Point( 242, 140 ) ) );
emitter.addInitializer( new Position( mz ) );
emitter.addInitializer( new Velocity( new PointZone( new Point( 0, 200 ) ) ) );
emitter.addInitializer( new Lifetime( 1.5, 1.5 ) );
emitter.addAction( new Move() );
emitter.addAction( new Accelerate(0, 200) );
emitter.addAction( new Age() );
emitter.addAction( new Fade() );

addChild( emitter );
emitter.start();
emitter.runAhead( 0 );
]]>
Let's take a shower http://flintparticles.org/forum/comments.php?DiscussionID=4&Focus=37#Comment_37 2008-03-25T17:02:48+00:00 2010-12-25T16:36:41+00:00 ericr http://flintparticles.org/forum/account.php?u=17 Why not use a bitmapZone for the start point? Just locate the image at the right point over the showerhead and there you go!