Fork me on GitHub
Not signed in (Sign In)

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

  1.  
    I added the below code to Particle2DUtils.createParticle2DFromDisplayObject to sync up the collision radius of my particles with the display object they are based upon. Otherwise the collision radius is set to 1 by default and does not behave properly. This does assume that width and height is the same, so perhaps there would be a better fix that would average the height and width to get a more accurate collisionRadius.

    // make new particles have the same radius as the width of the display object
    particle.collisionRadius = obj.width/2;
    //

    right above:
    particle.image = obj;
    return particle;
    • CommentAuthorRichard
    • CommentTimeNov 17th 2008
     
    Good idea. I've added it (using the average of width and height) in createParticle2DFromDisplayObject and createRectangleParticlesFromBitmapData.

    Thanks