How do I to apply a force on a wheel by touch?

Get help using Construct 2

Post » Thu May 15, 2014 11:31 am

I want apply a strength on a wheel by touch and rotate the wheel based on the strength of the event touch.
Thanks for the help
B
5
S
1
Posts: 37
Reputation: 453

Post » Thu May 15, 2014 11:44 am

Hi @markofb84, try to apply Torque towards the wheel at certain degree.

Check a simple sample that I have attached.

Cheers!
You do not have the required permissions to view the files attached to this post.
B
24
S
4
G
1
Posts: 177
Reputation: 1,827

Post » Thu May 15, 2014 11:56 am

Thanks I'll do some tests to reach the desired
B
5
S
1
Posts: 37
Reputation: 453

Post » Thu May 15, 2014 2:08 pm

I have changed your capx, I want to apply a force equal by touch event (swipe) to the sprite. How I do it?
You do not have the required permissions to view the files attached to this post.
B
5
S
1
Posts: 37
Reputation: 453

Post » Thu May 15, 2014 10:56 pm

So... you have to measure distance from the start point of the touch to its final touch.

Try this:
event: when touch starts -> action: save touch's X and Y in global variables
event: when touch ends -> action 1: save distance from those coordinates to the last touch X and Y; use the funcion "distance" like distance(x1,y1,x2,y2)
action 2: use the distance number as a reference to the force applied

=)
Let me know if you get stucked or succeed!
B
24
S
4
G
1
Posts: 177
Reputation: 1,827


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests