0 Favourites

Particle angle based on direction of travel?

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

    After a longer pause decided to try some game-making activity again and while looking at the available options Construct seemed like the best choice. Totally paying off so far (even if there's MUCH to learn).

    But onto the question - perhaps I'm missing something, but is there a way to have particle system particles have same angle as their travel direction? Currently it looks like this (let's pretend that the black arrow is our particle):

    <img src="http://i244.photobucket.com/albums/gg36/some9000/P1.png">

    And this would be the desired result:

    <img src="http://i244.photobucket.com/albums/gg36/some9000/P2.png">

    Also - is there a way to randomize the hue of each particle?

    If neither is both would be GREAT new features to add to the particle system.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • And this would be the desired result:

    <img src="http://i244.photobucket.com/albums/gg36/some9000/P2.png">

    Set the spray cone to 360 degrees?

    [quote:ugwzob83]Also - is there a way to randomize the hue of each particle?

    No, but you could layer a few different particle objects on top of each other and have different colors assigned to each one.

    Or you could make your own particle sprayer using sprites. Something like so:

    + Every whatever Milliseconds
    + Repeat numberOfParticles times
        -> Create Sprite at X, Y
        -> Set angle to random(360)
        -> Set speed to random(whateverSpeed)
        -> Set color filter to rgb(random(255), random(255), random(255))
    [/code:ugwzob83]
    
    If you use Bullet and Fade behaviors on them then they will move and fade out on their own.
  • Set the spray cone to 360 degrees?

    Thanks for the reply! I understand the movement of the particles just fine, here's an example of the problem:

    Let's say I want to do some impact sparks - sparks usually travel fast and thus look like lines instead of dots. So I pick a texture like this:

    <img src="http://i244.photobucket.com/albums/gg36/some9000/Spark.png">

    Now the result in Construct looks like this (note how they all just stay the same - and random rotation wouldn't help here either):

    <img src="http://i244.photobucket.com/albums/gg36/some9000/P1-1.gif">

    But it would be awesome to have each particle turn the direction of its movement, like this:

    <img src="http://i244.photobucket.com/albums/gg36/some9000/P2-1.gif">

    Or you could make your own particle sprayer using sprites. Something like so:

    Yeah, was considering it, but that seems a little wasteful on resources, I bet a dedicated particle system is faster. Already using something like that for missile trails, for example.

  • Ah, I see. No, the particles don't angle themselves like that.

    Yeah, was considering it, but that seems a little wasteful on resources, I bet a dedicated particle system is faster. Already using something like that for missile trails, for example.

    True, it's not as efficient as particles, but as long as you don't have thousands of sparks on the screen at once it should be okay. And you could easily get that angling thing you're after with sprites.

  • Ok, will have to try it with sprites then. Thanks for the code sample.

    Also sounds like something for the suggestion topic - since this rotation thing is quite common in most particle systems and quite handy too.

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