Welcome, Guest
Want to take part in these discussions? Sign in if you have an account, or apply for one below
-
- CommentAuthornewuser9090
- CommentTimeApr 16th 2009 edited
aaa -
- CommentAuthorRichard
- CommentTimeApr 16th 2009
You'll need to add custom code to turn-off particles once they've settled - remove them from the emitter and draw them as fixed pixels in the bitmap. That way Flint only has to handle the particles that are moving. You'll also need some code to manage the collisions with the drawn pixels. -
- CommentAuthornewuser9090
- CommentTimeApr 17th 2009 edited
aaa -
- CommentAuthorTit_Nelly
- CommentTimeNov 30th 2009
Hi. I'm working on a snowing project. The goal is to simulate some falling snow... But there is obstacles on the stage and I want to keep the snow on the obstacles and on the back of the stage.
I've read your answer but I did'nt understand how to turn-off particles once the've settled and how to draw them as fixed pixels.
I work with the code wrinting in the tutorial.
Can you help me?
Thanks a lot... -
- CommentAuthorTit_Nelly
- CommentTimeDec 3rd 2009
Hello,
I did not have any answer. Can nobody help me? That makes one week that I read documentation without understanding how to make to stop the particles on the obstacles.
I just want to create a really nice snow effect. How can I make it? -
- CommentAuthorRichard
- CommentTimeDec 4th 2009 edited
If you remove the particle from the emitter, either by setting its isDead property to true (which causes the emitter to remove it itself) or by removing it from the emitter's particles array. If the particle isn't in the emitter then the emitter won't draw the particle any more.
All the information about a particle is in it's properties - x, y, image, scale, etc. This is the information Flint uses to draw the particle and is also the information needed to draw the particle yourself.
If you don't want to draw the particle yourself, you could set up another emitter with no counter, initializers or actions, and add those particles that you want to remove from the first emitter into the second, using the addExistingParticles method of the emitter. Then the second emitter will take over the drawing of the particles. N.B. This won't work if the isDead property is true since the first emitter will return the particle to the particle pool and it'll all go horribly wrong.
1 to 6 of 6
