An interesting problem with Swiping

Get help using Construct 2

Post » Wed Jun 11, 2014 5:42 pm

I am wondering if it is possible to swipe objects to rotate in both clock-wise and anti-clockwise manner about a center? Like if I wanted to rotate the stars about the center, just move 1 place up or down depending on whether I wanted clockwise or anticlockwise motion, then would it it be possible.

Image

I think one would have to swipe across at least 3 stars to know in which direction the stars are supposed to move but how to actually code it? :?
B
5
Posts: 21
Reputation: 267

Post » Wed Jun 11, 2014 7:05 pm

You do not necessarily need a sample greater than two points. A vector should be sufficient.
If touch end x is > touch start x then angle is anticlockwise.
If touch end x is < touch start x then angle is clockwise.
If touch end y is > touch start y then angle is clockwise.
If touch end y is < touch start y then angle is anticlockwise.
Image ImageImage
B
169
S
50
G
174
Posts: 8,331
Reputation: 110,806

Post » Wed Jun 11, 2014 7:28 pm

"You do not necessarily need a sample greater than two points. A vector should be sufficient. "


I was actually getting ahead of myself when I said that - I was thinking what if there were two intersecting star groups like in the image below. :oops:

Image

Anyways, any help is very welcome. This thing has gotten into my head and it just won't let go. :evil: Very annoying.
B
5
Posts: 21
Reputation: 267


Return to How do I....?

Who is online

Users browsing this forum: JackTYGA, zill and 37 guests