How do I set up a spiral path with pathfinding? (SOLVED)

Not favoritedFavorited Favorited 0 favourites
  • 9 posts
From the Asset Store
Vector illustration of 5 spiral characters with transparency in 3 different colors.
  • I'm trying to guide an object along a spiral path to the edges of the viewport.

    Any help, as ever, is appreciated!

  • I guess you can put obstacles to form a spiral path.

    Why does it have to be with pathfinding? There are other options - MoveTo, Tween, timelines.

  • I'm open to the tween and move-to options. Not so much the timeline, as I've found even with easing the movements can be choppy.

    Plus the spiral will have to get bigger or smaller, based on RNG.

  • Can you draw a picture of that spiral path?

    Here is another behavior you can use:

    construct.net/en/make-games/addons/198/spline-movement-c3-runtime

    Demo project:

    dropbox.com/scl/fi/b7znsclmmgnkzpi8cracv/spline_demo.c3p

  • Can you draw a picture of that spiral path?

    Here is another behavior you can use:

    https://www.construct.net/en/make-games/addons/198/spline-movement-c3-runtime

    Demo project:

    https://www.dropbox.com/scl/fi/b7znsclmmgnkzpi8cracv/spline_demo.c3p?rlkey=9fogcjirerhfodmvbwwmxj8sw&st=3t05wgrv&dl=0

    I have a feeling this will be helpful, so I've already installed the addon.

    The object that I plan on using this for (the αray, in this example) will spawn from something else. It will take a path between a slight curve and a fibonacci spiral, again depending on rng.

    So, from something like this:

    to something like this:

    And anything in between.

    But here's the thing: The spawn point (The green ball) will also be moving. That part I've already figured out with spline addon, but as for updating several instances of an invisible sprite around the object at the time of the spawn, that's where I'm scratching my head.

  • Couldn’t you just use the bullet behavior, and rotate behavior but gradually reduce the turning rate to zero?

    Behaviorless is similar and easier for me to write off the top of my head and would be:

    Every 1 second
    — create bullet at sprite.x, sprite.y
    — bullet: set angle to random(360)
    — bullet: set turningRate to random(30,120)
    
    Every tick
    — bullet: move forward 150*dt pixels
    — bullet: set turningRate to lerp(self.turningRate, 0, 0.05)
    — bullet: rotate self.turningRate*dt degrees

    If you used behaviors then you’d basically reuse the action that sets the turning rate to some extent.

  • Couldn’t you just use the bullet behavior, and rotate behavior but gradually reduce the turning rate to zero?

    Behaviorless is similar and easier for me to write off the top of my head and would be:

    Every 1 second
    — create bullet at sprite.x, sprite.y
    — bullet: set angle to random(360)
    — bullet: set turningRate to random(30,120)
    
    Every tick
    — bullet: move forward 150*dt pixels
    — bullet: set turningRate to lerp(self.turningRate, 0, 0.05)
    — bullet: rotate self.turningRate*dt degrees

    If you used behaviors then you’d basically reuse the action that sets the turning rate to some extent.

    If I'm reading this right, then the turning rate in behavior form would be the rotate speed. In that case, since I am using behaviors, how would I gradually reduce the rotate speed to 0?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Set rotateSpeed to lerp(rotateSpeed, 0, 0.05)?

  • Set rotateSpeed to lerp(rotateSpeed, 0, 0.05)?

    After a few tweaks, that seems to be it! Thanks!

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