Manual control of particle system?

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.
Post Reply
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Manual control of particle system?

Post by Taehl »

Quite simply, how do I make Love's particle system emit a particle at a given point? I don't need any of this auto-emission stuff. Just a function like emitParticle(ParticleSystem, x, y). I can't seem to get any regularity out of it by using setPosition, start, update...
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
User avatar
Raylin
Prole
Posts: 30
Joined: Thu Dec 30, 2010 8:48 am
Location: Chicago
Contact:

Re: Manual control of particle system?

Post by Raylin »

I dunno if this is completely correct... but couldn't you instantiate a new ParticleSystem with a buffer of 1 and set the values accordingly?
From there, you could just make an emitParticle function, yeah?
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: Manual control of particle system?

Post by Taehl »

I don't know if that would work, but it would certainly chew up a horrendous amount of resources...
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
User avatar
Raylin
Prole
Posts: 30
Joined: Thu Dec 30, 2010 8:48 am
Location: Chicago
Contact:

Re: Manual control of particle system?

Post by Raylin »

Well, not exactly.
You instantiate the new ParticleSystem in love.load.
Then, you set the position of the system and start and stop it in the function.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: Manual control of particle system?

Post by TechnoCat »

Raylin wrote:I dunno if this is completely correct... but couldn't you instantiate a new ParticleSystem with a buffer of 1 and set the values accordingly?
From there, you could just make an emitParticle function, yeah?
I thought about that as an answer, but then that brings a particle system management problem. So I didn't suggest it. :3

The idea of starting, updating, and stopping only works if the time passed is long enough to only emit one particle (and not two, or three, or none). The particle system will continue updating the particles if it is stopped I believe. But, you probably already knew that, but were indeed having the emit only one problem.
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: Manual control of particle system?

Post by Taehl »

So... Are you saying that Love doesn't have a function to just emit a particle? Really?
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Manual control of particle system?

Post by Robin »

I guess because if you only need one particle there's no need for a ParticleSystem.
Help us help you: attach a .love.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Manual control of particle system?

Post by kikito »

Yes. If you need to move a single particle around, it's just easier to use love.graphics.draw and move the single image yourself.
When I write def I mean function.
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: Manual control of particle system?

Post by Taehl »

No, I need to emit one particle at a given point. I'm going to do this several hundred times as I calculate coordinates. I need to use the particle system because love.draw is too slow for me to add another five hundred or so draws.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 58 guests