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 » Sat Feb 20, 2010 8:47 pm

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 213 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 » Sat Feb 20, 2010 11:15 pm

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 » Sat Feb 20, 2010 11:21 pm

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 » Sat Feb 20, 2010 11:29 pm

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 » Sat Feb 20, 2010 11:32 pm

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 » Sat Feb 20, 2010 11:39 pm

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 » Sat Feb 20, 2010 11:41 pm

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 » Sat Feb 20, 2010 11:51 pm

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 » Sun Feb 21, 2010 7:52 am

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 » Sun Feb 21, 2010 3:11 pm

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: No registered users and 49 guests