Page 1 of 3

How do I attach a circle physics object to a particle?

Posted: Sat Feb 20, 2010 8:47 pm
by Xoria
For element 7(in the code), how do I make it so that a new circle physics object is "behind" the particle drawn with the same rotation, position and scale when you draw it? TIA

Re: How do I attach a circle physics object to a particle?

Posted: Sat Feb 20, 2010 11:15 pm
by Xoria
Um, I just realized that the only particle related X & Y you can retrieve is the emmiter's, so do I make the emiter's position the same as a particle's position? Doubt that it's possible. Is this whole thing plausible? :?

Re: How do I attach a circle physics object to a particle?

Posted: Sat Feb 20, 2010 11:21 pm
by DustinEwan
I asked almost this exact same question about a month ago and the short answer is that you cannot do this.

If you're like me and you thought about using the particle system for shoot em up bullets, then the solution is to make an object for each bullet and track each bullet individually. It's really not that difficult, just seems dumb when the particle system is so legit.

Re: How do I attach a circle physics object to a particle?

Posted: Sat Feb 20, 2010 11:29 pm
by Xoria
Good idea. But I noticed that love.physics and adding images to that looks uglier than adding images to love. graphics. And I'm trying to make a very graphical dependent game, so...

Re: How do I attach a circle physics object to a particle?

Posted: Sat Feb 20, 2010 11:32 pm
by DustinEwan
I don't really understand what you're saying.

Use a sprite (love.graphics.newImage) and simply have it over the location of the body..

The image itself has nothing to do with love.physics apart from making sure they align. Now, if it looks bad when it's rotated, that's an entirely different problem.

Re: How do I attach a circle physics object to a particle?

Posted: Sat Feb 20, 2010 11:39 pm
by Xoria
Oh, I forgot about about love.sprite. Great now I'm not stuck anymore.

Re: How do I attach a circle physics object to a particle?

Posted: Sat Feb 20, 2010 11:41 pm
by DustinEwan
You're welcome ;)

Re: How do I attach a circle physics object to a particle?

Posted: Sat Feb 20, 2010 11:51 pm
by kikito
You might get that "dumb" feeling because of its name. "Particle" certainly sounds like something that could have mass, or could be manipulated. But when you read "Particle", try to read "Image moved by the graphics card so it is very fast".

Having your graphics card interact with LUA or Box2D would just kill the idea.

Particle systems are good for non-interactive stuff, like smoke, explosions, holograms, etc. For interactive stuff, you will certainly need to manage your objects yourself.

Re: How do I attach a circle physics object to a particle?

Posted: Sun Feb 21, 2010 7:52 am
by Robin
kikito wrote:Particle systems are good for non-interactive stuff, like smoke, explosions, holograms, etc. For interactive stuff, you will certainly need to manage your objects yourself.
Exactly, Particle systems are for visual effects only.

Re: How do I attach a circle physics object to a particle?

Posted: Sun Feb 21, 2010 3:11 pm
by Xoria
Nice analogy.

Can someone lead me to a good sample of sprites being used? The wiki doesn't thoroughly show me how to implement them..