Closure on pathways?

mhedgesmhedges Raised on VCSMember Posts: 634

Hello -

There are various threads on pathways (paths, swipes, actor follows path created through swipe).

I don't believe any one addresses a routine after a path intercepts itself (be it a circle, oval, polygon, whatever). Can GS handle a routine in which the user creates a closed circle using the swipe method, GS recognizes the path has been closed, and perform a behavior on the actors inside or outside of that closed circle?

For example, if an actor in the screen is a car, and I circle-swipe the car, then some behavior occurs to the car (say, it gets destroyed). Or to take it a step further, I circle-swipe two ants, and the ants get destroyed).

To me, the crux lies in recognizing when a swipe is closed, and then creating some area based on the swipe. The behavior applied to the cars or ants that collide with the resulting area should be easier.

Thanks, regards.

Comments

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    Maybe a closed swipe / path could be determined by comparing the first touch points X and Y to the last touch point X and Y with the magnitude function. If it's small enough (lets say less than 20), it's a closed path.

    Mental Donkey Games
    Website - Facebook - Twitter

  • mhedgesmhedges Raised on VCS Member Posts: 634

    It would have to discern from just moving in a direction less than a minimum distance, possibly collide with a segment/line between two points. Just collecting thoughts at this moment.

  • SocksSocks London, UK.Member Posts: 12,822

    @NipaDidIt said:
    Maybe a closed swipe / path could be determined by comparing the first touch points X and Y to the last touch point X and Y with the magnitude function. If it's small enough (lets say less than 20), it's a closed path.

    That would return false positives / negatives.

    For example (see image below) if the distance was 200 pixels (so less than 200 indicates 'closed') the two examples below would return false results.

  • mhedgesmhedges Raised on VCS Member Posts: 634

    Exactly.

    May have to rethink it a bit. Like a snake or fruit ninja swipe. Collision detected, close a circle. Still open, start to destroy tail-end.

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    Here is a quick and dirty stab at it. It might spur some ideas.

  • mhedgesmhedges Raised on VCS Member Posts: 634
    edited September 2015

    @RThurman, this is thinking outside the box! You're right thinking that no matter the trail (circle, oblong, polygonal), if it surrounds the object, it can de destroyed. Mad respect.

    Let me play with this a bit to see if I can combine the desired effects.

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    Glad you find it useful!

Sign In or Register to comment.