I didn't see any sort of callback functionality in the Lifetime
controller, so I instead used Pyglet's clock functionality to schedule
the event.
This seems to work fine, but I'd like to make sure there isn't a
better way. Is there?
Before I can give an answer, here's some questions for you:
- Are you using separate group(s) for each explosion?
- If not, what is it you want to remove exactly?
-Casey
> --
> You received this message because you are subscribed to the Google Groups "General discussion of the Lepton particle engine for Python" group.
> To post to this group, send email to py-lept...@googlegroups.com.
> To unsubscribe from this group, send email to py-lepton-use...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/py-lepton-users?hl=en.
>
>
Is either of those options better than the other?
Emitters are really cheap to create and destroy (certainly in relation
to groups), so its up to you whether you want to reuse them or throw
them away for each explosion. I think it would be cleaner and less
bug-prone to use a separate emitters for each explosion. Otherwise I
can imagine cases where the emitter is re-used before it has a chance
to finish emitting particles for the previous effect.
-Casey
By the way, I'm really impressed with Lepton. It is a fantastic
library. Very Pythonic, easy to use, and fast. Keep up the good
work!
On Feb 19, 10:51 am, Casey Duncan <casey.dun...@gmail.com> wrote:
> Yes, using a single group will be simpler and more efficient. This
> will mean there are far fewer memory (re)allocations happening at
> run-time. The only real reason to use multiple groups is so that you
> can closely control the draw order or other drawing state for each
> group independently.
>
> Emitters are really cheap to create and destroy (certainly in relation
> to groups), so its up to you whether you want to reuse them or throw
> them away for each explosion. I think it would be cleaner and less
> bug-prone to use a separate emitters for each explosion. Otherwise I
> can imagine cases where the emitter is re-used before it has a chance
> to finish emitting particles for the previous effect.
>
> -Casey
>
-Casey