0 Favourites

Problem with Particles

This forum is currently in read-only mode.
  • Hello there, Constructors!

    I'm relatively new to construct (been messing around with it for about a month). But recently i've stumbled upon a problem that is just out of my reach of solving. So before i rip my pants in two out of frustration i turn to you in a final attempt of solving the matter.

    Well, the problem concerns particles and my inability to specify which one of the instances i wish to destroy during a collision with another object.

    This works perfectly well when using 'normal' objects when creating a collision event alone specify that it is the instance colliding that should be destroyed and not the entire object and all of its instances. With particles, though, this doesn't seem to be the case.

    Summary: When destroying a particle in a collision event, all instances of the particle is destroyed. I wish to be able to control this, but how?

    The .cap is not the project itself (too big and too messy), so I've done a simulation of the problem alone(the same things still occure):

    http://www.mediafire.com/?up52o8tglxh2ap2

    I would be endlessly thankfull for any help.

    Thanks!

  • Summary: When destroying a particle in a collision event, all instances of the particle is destroyed. I wish to be able to control this, but how?

    that should be simple... you can't. you must make your own particle simulation. you can create a sprite, give it a ball movement behavior, uncheck the "rotate object" (something strange happens if you don't, actually) and when you want it to go boom, you must:

    on somethingsomething:

    repeat (100)

    -> create sprite somewhere

    -> set ball angle of motion to random(359)

    -> set ball movement speed 50+random(50).

    -> set ball movement acceleration to -50

    on sprite collision with somethingsomething:

    -> sprite: destroy

    above is just an example, but try it, you should be fine

  • Ok, if you are trying to destroy the particle effect and the sprite at the same time, then this is easy.

    Join the ball and the particle effect with a container, which is in the properites of each object. It is just a link so it doesn't matter which object you do it to, it will affect both.

    Now they will create and destroy together, you only need to handle the positioning yourself. So in your events you need to delete the creation of the particles, and delete the destroy events for the particles as well.

    Hope that is what you were after.

    Here is the edited cap by the by.

    http://dl.dropbox.com/u/1487524/Scirra/ ... xample.cap

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Thanks for the quick responses guys!

    Really helpfull! Problem solved.

    And Steven, your example worked exactly the way I intended it to. Thanks a bunch!!

    xD

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)