Particle lifetime and interaction

0 favourites
  • 12 posts
From the Asset Store
Elevate your games with our modern collection of professionally designed, high-quality user interface sounds.
  • Hi! I wanted to use Particles as kind of item drop from an enemy. If the enemy dies, particles are created once (One-Shot, 360? cone) and then the player should be able to collect them. But it seems there are a few problems.

    1. I tried to create ever lasting particles in a One-Shot but it seems this is not possible. They are destroyed after the Timeout (or faded out).

    Is it possible to let them stay forever somehow? (if not I will have to deal with it and let them fade out after a few secs)

    2. Can you interact with parcticles somehow? I tried "When Player overlaps Particles" and "On Player Collision with Particles" >> Particles Destroy - but it seems both do not work. Can you check if particles were "touched" to collect and destroy them?

    3. Is it possible to let the particles react to other objects with physics? (bounce off)

    If this is not possible, does anyone know a (good) way to create a similar effect with sprites? Maybe creating sprites with bullet behaviour and random angles and slow them down over time?

    regards,

    Bl4ckSh33p / Alex

  • I'm not sure spawning sprites at particles is possible, but why not just spawn the sprites you want to interact with with bullet behaviour. maybe using the particles as well to improve the look.

  • You can't interact with particles. Particles are the lowest graphical representation value. This offers the ability for high count particles and low memory cost. However then the partciles don't have enough info to be able to do anything else than be an image with an XY value.

    If you need to interact with particles. Then you need to create sprites that behave like particles.

  • Yes to all.

    1. Set timeout to 9999

    2. Give it solid behaviour then you can interact with it using those commands

    3. Yep, give the particle the physics or bullet behaviour

    Sprites are easier but I guess use Particles if you want some elaborate animation.

  • I didn't want to spawn sprites at particles, but this is an interesting idea. ;)

    Thank for the hint with behaviors!

    I added the "Solid" Behavior and "On Collision" worked, BUT when I hit a particle all particles were deleted, not the ones I hit. So it seems you cant handle every particle as its own object?

    Since the particles "explode" with x pixel per sec and a -y deceleration they stop after a while and fly backwards. So I have to "kill" them before this happens - or do you know a workaround for this as well?

  • make your own particles function - something like

    https://dl.dropboxusercontent.com/u/143636437/examples%20for%20web/fnparticles.capx

    in this quick example click the left mouse to create 8 sprites at the players location -

    just call the function with param(0) and param(1) being the location where the sprites will appear. Param(2) is the number of boxes. the boxes will spread out over 360 deg. alter family bullet behaviour for different effects. You could always add real particles/ rotation/ resize to make it flasher

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you very much for sharing your examples!

    This will help me a lot. <img src="smileys/smiley20.gif" border="0" align="middle" />

    PS: : When you set the particles to solid I noticed there is an invisible square you can run into.

  • Yeah I doubt you can specify each particle separately. I'm sure you can do what you want to do with sprites. Is the particle animation that important to the game?

    You can't set up collision for particles so I guess it depends on the image you used.

  • The particle animation is not so important, it was just a nice way to "spread out" a few small dots and I wanted them to be collectable as kind of powerup/healing item for the player. The example from RamPackWobble above does the same with sprites and I will use a variant of this. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Thank you very much for sharing your examples!

    This will help me a lot. <img src="smileys/smiley20.gif" border="0" align="middle" />

    PS: : When you set the particles to solid I noticed there is an invisible square you can run into.

    Glad you find them useful. Looking forward to seeing what you come up with.

  • You can easily do collisions with particles like this...

    Enjoy

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