How do I Rotate an object based on touch position,(turntable

Get help using Construct 2

Post » Sun Feb 08, 2015 8:49 pm

I would like to do something like a Turntable, where based on the touch position, you can spin forward backward the object. I don't think sound could be done like this as well could it? something like "DJ scratches"?
B
12
S
3
G
4
Posts: 61
Reputation: 3,464

Post » Sun Feb 08, 2015 10:35 pm

On touch set initx, inity variables to touch xy, set isintouch variable to 1
variable isintouch=1, set mydist variable to distance(initx,inity,touch.x,touch.y)
->initx>touch.x, do foo
->initx<touch.y, do pitydafoo
Image ImageImage
B
165
S
49
G
148
Posts: 8,049
Reputation: 97,090

Post » Fri Feb 27, 2015 6:44 am

Can you please explain this code neatly .I'm not able to understand it properly beacuse im new to construct 2.


On touch set initx, inity variables to touch xy, set isintouch variable to 1
variable isintouch=1, set mydist variable to distance(initx,inity,touch.x,touch.y)
->initx>touch.x, do foo
->initx<touch.y, do pitydafoo

I want to rotate the wheels by touch .If i move my finger clockwise then wheels should rotate clockwise and if i move my finger anticlockwise then it should move anticlockwise direction.

Can you please put .capx file or put code of rotation of wheels by touch gesture .
B
3
Posts: 7
Reputation: 195

Post » Mon Mar 16, 2015 11:28 am

I got the solution. We can do it by the event -> wheel , followed by the action -----> set angle towards(Touch.X,Touch.Y) :)
B
3
Posts: 7
Reputation: 195


Return to How do I....?

Who is online

Users browsing this forum: Emac, kiko2015, Monkin8r and 7 guests