How do I throw a ball with drag and drop?

Get help using Construct 2

Post » Mon Mar 09, 2015 4:05 am

Trying to throw the ball at the same rate as drag and drop..any help would be appreciated.
You do not have the required permissions to view the files attached to this post.
B
21
S
6
Posts: 58
Reputation: 1,385

Post » Tue Mar 10, 2015 2:01 pm

on start of drag, store, x,y and tick start

on release, compare the x,y to current touch x,y and ticks passed

This gets you the: angle, distance and ticks passed during movement :)

These variables should be enough to determine a speed for the ball.
Who dares wins
B
50
S
10
G
10
Posts: 1,728
Reputation: 12,867

Post » Tue Mar 10, 2015 2:57 pm

Another solution would be to story previous X and Y as instance variables, and then on release, you use the difference between previous xy and current xy to get your Velocity. This and dt gets you the speed AT the moment of release. Theres also a couple different ways to average over the last few frames before release.
B
14
S
5
G
1
Posts: 189
Reputation: 1,536

Post » Mon Mar 16, 2015 5:34 pm

lennaert wrote:on start of drag, store, x,y and tick start

on release, compare the x,y to current touch x,y and ticks passed

This gets you the: angle, distance and ticks passed during movement :)

These variables should be enough to determine a speed for the ball.


Thanks..I appreciate it!
B
21
S
6
Posts: 58
Reputation: 1,385


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests