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

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Xoria
Citizen
Posts: 61
Joined: Sun Jan 31, 2010 1:24 am

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

Post 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
Attachments
main.lua
(8.09 KiB) Downloaded 303 times
Xoria
Citizen
Posts: 61
Joined: Sun Jan 31, 2010 1:24 am

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

Post 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? :?
DustinEwan
Prole
Posts: 18
Joined: Wed Oct 21, 2009 7:20 pm

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

Post 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.
Xoria
Citizen
Posts: 61
Joined: Sun Jan 31, 2010 1:24 am

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

Post 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...
DustinEwan
Prole
Posts: 18
Joined: Wed Oct 21, 2009 7:20 pm

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

Post 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.
Xoria
Citizen
Posts: 61
Joined: Sun Jan 31, 2010 1:24 am

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

Post by Xoria »

Oh, I forgot about about love.sprite. Great now I'm not stuck anymore.
DustinEwan
Prole
Posts: 18
Joined: Wed Oct 21, 2009 7:20 pm

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

Post by DustinEwan »

You're welcome ;)
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

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

Post 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.
When I write def I mean function.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

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

Post 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.
Help us help you: attach a .love.
Xoria
Citizen
Posts: 61
Joined: Sun Jan 31, 2010 1:24 am

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

Post 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..
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 5 guests