Particles and Containers

For questions about using Classic.

Post » Fri Dec 03, 2010 4:18 pm

I am simulating a spotlight using particles. the particles spread at a 10degree angle, and are contained within a container together with a sprite that is 1x1 pixel in size.

The 1x1 sprite is used to trace a path in the world, and every time it collides with anything, particles are generated using the one shot method.

Problem:
1) the system deletes the particle automatically once the one-shot is complete done, which in turn deletes my 1x1 sprite. This is not the behavior I desire.

2) I need a way to delete the particles associated with a given emitter at any time. The idea is that I would have my 1x1 sprite and the particles moving at the same speed, when the 1x1 sprite collides with anything, I will delete the old particles and spawn a new one-shot emitter in the new direction.

Unfortunately, I have not been able to delete any generated particles. This must also be done in a way that leaves the emitter in tact, so the 1x1 sprite stays alive

Any help would be appreciated. Thanks.
B
2
G
2
Posts: 24
Reputation: 698

Post » Fri Dec 03, 2010 4:44 pm

Might try taking off the container, and use the object pairer.
Could also try the timer behavior.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Fri Dec 03, 2010 5:39 pm

Well thats a good start, how about the part where I need to delete the particles? Is there a way around that?
B
2
G
2
Posts: 24
Reputation: 698

Post » Fri Dec 03, 2010 5:57 pm

One shot means the particle will self destroy when its finished.
If you don't want to spawn a new one each time you could just enable/ disable it instead.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests