Closure on pathways?
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
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
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.
My Blog / App Store / Google Play
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.
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.
My Blog / App Store / Google Play
Here is a quick and dirty stab at it. It might spur some ideas.
@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.
My Blog / App Store / Google Play
Glad you find it useful!