Encircle gesture challenge!
This one is for the experts!
How would you encircle an actor with a gesture? For example say the actor is a ball coming down from the top of the screen. I want to get points by drawing an invisible swiped circle around the actor.
How would you encircle an actor with a gesture? For example say the actor is a ball coming down from the top of the screen. I want to get points by drawing an invisible swiped circle around the actor.
Comments
How it works is when you draw the line, it makes a bunch of line segments. A function then loops through the line segments and sees if any of them cross. And if the object is within those bounds.
ORBZ has a demo of drawing lines on his wall, that might be able to get you started.
The math function you are looking for is determining if two line segments intersect. you'll need to google for it.
However, without access to an array to store the line segments, and a way to loop through it, it will be extremely difficult to do this in GameSalad!
Determine initial vector to angle from ball to touch
If initial angle - current angle = 360 or -360 then result
But because the initial vector to angle is an angle-type attribute it won't allow negative numbers. so I think it will have to be something like this:
Determine initial vector to angle from ball to touch
Determine direction and amount of movement (clockwise or anti clockwise)
When the maximum amount moved in either rotation = 360 then result
Any other ideas most appreciated!
POM's Party Popper does touch detection of a circular motion ... now that we can message... leave him a request for help...
MH