How do I - Spread bullets apart until not overlapping

0 favourites
  • 1 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Hello Hello. - Would anyone be so kind as to educate me on how I would achieve this effect?

    • Subscribe to Construct videos now
      - <---- Notice the way that the little units spawn out of the buildings neatly side by side? This is what I'm trying to achieve.

    A straight up "This is how its done" would be appreciated it, but I wouldn't mind a hint in the right direction

    At the moment my units kind of just cluster all over each other and it makes it difficult to see how many are coming.

    I can't wrap my head around how I would get overlapping units to slowly spread away from each other until they are not overlapping anymore, and continue their trajectory.

    how do I tell the sprite to move away to the side that its closest to? (So it doesn't go 100 pixels to the right, when 10 pixels to the left would have accomplished it)

    I don't know the proper string to type in to do something so dynamic. The best I could come up with was

    "-1x, -1y"

    repeat until not overlapping.

    But that would cause issues if the bullets were heading towards that direction anyway and it would just accelerate them awkwardly.

    ------

    I think what I need is a way to spawn my bullets but in a spread pattern that they don't collide with each other.

    If anyone could point me towards a tutorial that handles something like this, would greatly appreciate it.

    Anything I found was relating to setting bullet angle to random to simulate shotgun spread, but that won't work so well for me.

    Thanks in advance guys.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)