Flint Particle System Forum - adding sound to particles Tue, 13 Dec 2011 06:16:25 +0000 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher adding sound to particles http://flintparticles.org/forum/comments.php?DiscussionID=330&Focus=1130#Comment_1130 http://flintparticles.org/forum/comments.php?DiscussionID=330&Focus=1130#Comment_1130 Sat, 27 Feb 2010 21:56:49 +0000 priest
Can someone point me in the right direction to get started? Should I extend the Particle class to add a sound property? Would I also need to change the Emitter and ParticleFactory classes, etc.?

I'm an OOP noob. I have ActionScript books on hand to help with the basics, but I would greatly appreciate as much detail and patience as you can muster. Open-source examples of similar efforts would be helpful too.

Thank you! ]]>
adding sound to particles http://flintparticles.org/forum/comments.php?DiscussionID=330&Focus=1131#Comment_1131 http://flintparticles.org/forum/comments.php?DiscussionID=330&Focus=1131#Comment_1131 Sun, 28 Feb 2010 06:54:15 +0000 priest
I may pop back in with some more refined questions shortly. If I produce something worth sharing I'll post a link. Can't thank you enough for sharing this wonderful framework. ]]>
adding sound to particles http://flintparticles.org/forum/comments.php?DiscussionID=330&Focus=1134#Comment_1134 http://flintparticles.org/forum/comments.php?DiscussionID=330&Focus=1134#Comment_1134 Tue, 02 Mar 2010 02:33:04 +0000 priest

  1. I can get both their masses, but I can only access velX and velY for otherObject, not for the particle referenced by the particlesCollision object. If I try to access particle.velX as follows

    public function collisionHandler( e:ParticleEvent ) {
    trace("particle velX = " + e.particle.velX);
    }


    I get the following error message: 1119: Access of possibly undefined property velX through a reference with static type org.flintparticles.common.particles:Particle.

    Substitute e.otherObject.velX above and it displays a credible velocity value. What am I missing? Also, when two particles collide, how does Flint determine which is the particle and which is the otherObject?

  2. Is it possible to configure a bounding box so that a collision is registered when a particle strikes it?

]]>
adding sound to particles http://flintparticles.org/forum/comments.php?DiscussionID=330&Focus=1149#Comment_1149 http://flintparticles.org/forum/comments.php?DiscussionID=330&Focus=1149#Comment_1149 Tue, 16 Mar 2010 14:22:00 +0000 Richard
particle.dictionary["sound"] = ...

The particle property of the ParticleEvent is of type Particle - the base class for 2D and 3D particles. To use it's velX property you will need to cast it to a Particle2D

public function collisionHandler( e:ParticleEvent ) {
trace("particle velX = " + Particle2D( e.particle ).velX);
}


Unfortunately the bounding box class doesn't dispatch an event when the collision occurs. It's a good suggestion and I'll add it as a feature shortly. meanwhile, you could edit the class yourself to dispatch an event when a collision occurs. ]]>
adding sound to particles http://flintparticles.org/forum/comments.php?DiscussionID=330&Focus=1150#Comment_1150 http://flintparticles.org/forum/comments.php?DiscussionID=330&Focus=1150#Comment_1150 Wed, 17 Mar 2010 10:27:23 +0000 Richard adding sound to particles http://flintparticles.org/forum/comments.php?DiscussionID=330&Focus=1192#Comment_1192 http://flintparticles.org/forum/comments.php?DiscussionID=330&Focus=1192#Comment_1192 Fri, 07 May 2010 23:41:08 +0100 priest
I've had to drop my project for a while, but am resuming now, so I will try your .dictionary method. ]]>