# Parabola/Tracjectory tracing with Physics / Box2D

Get help using Construct 2

### » Sun Mar 31, 2013 12:09 pm

@R0J0hound
Thank you very much! :)
B
5
S
1
Posts: 12
Reputation: 556

### » Sun Mar 31, 2013 2:37 pm

@R0J0hound
Can we reverse the direction of the mouse? So when we move the mouse backward, the parabola move forward,and vice versa. And when we move the mouse down, it gets higher, and vice versa. Thanks
nothaseo2013-03-31 14:37:45
B
65
S
15
G
6
Posts: 103
Reputation: 8,424

### » Sat Apr 13, 2013 10:43 am

@R0J0hound
Hi, it doesn't work with Touch... How we can use Touch and remove Mouse?
Thanks! :)
B
5
S
1
Posts: 12
Reputation: 556

### » Sat Apr 13, 2013 7:49 pm

You can replace the events, be aware though that touch will revert to 0,0 when not 'in touch' so it will act a little differently to what you may expect.

If you're using touch, you may want to have a second invisible sprite and use its x/y coords instead, and have it update its position to the touch position only when in touch.
B
27
S
9
G
5
Posts: 495
Reputation: 11,964

### » Tue Oct 08, 2013 3:12 pm

@bon4ire
Do you have any solution for your own question because I m also get the same query. I changed all mouse event into touch event after that ball is not launching..

Do you have any idea how to resolved it............
B
12
S
2
G
3
Posts: 57
Reputation: 3,439

### » Fri Oct 18, 2013 1:20 pm

Hi! Rojo's example for calculating trajectories is great! Just what I needed. Now I'm applying this to a game centered on jumping and would like to limit the extent of the trajectory so that it will only extend to a certain point and won't follow the mouse beyond that point on both x and y axis. Does anyone have any advice on how to do this? My starting point is Rojo's example :)
B
2
Posts: 1
Reputation: 152

### » Fri Oct 18, 2013 7:42 pm

For the undamped version add an action to the top of event 4 to set step to mouse.x/vx/11.

Or in general:
(targetx-startx)/vx/loop_length

For the damped version it is more complicated. The basic objective is taking the equations for x and y positions and solving for the time when x and y are at the mouse.
B
95
S
33
G
128
Posts: 5,491
Reputation: 81,570

### » Wed Apr 22, 2015 6:29 am

Hi guys,

I have read your topic, ad I have tried to understand how your exemple run. I have made a clone but the parabole doesnt work, I don't understand why

You find my example here: https://www.dropbox.com/s/yzulswlnjrxgh ... .capx?dl=0

thanks a lot
B
4
Posts: 4
Reputation: 218

### » Thu Nov 19, 2015 3:35 pm

@JohnnySix Would you share the capx for the tank example?

thanks,
B
126
S
51
G
25
Posts: 401
Reputation: 22,867

### » Thu Sep 22, 2016 5:02 am

R0J0hound wrote:For the undamped version add an action to the top of event 4 to set step to mouse.x/vx/11.

Or in general:
(targetx-startx)/vx/loop_length

For the damped version it is more complicated. The basic objective is taking the equations for x and y positions and solving for the time when x and y are at the mouse.

i know this is old but this is the best example of how to do a parabola, is there a way that i can change the even that launches the ball for an input? when i do it it doesnt work, for example "on touched object" as i want to do a button on screen that launches it, i also tried with functions but didnt work.

B
39
S
14
G
7
Posts: 408
Reputation: 8,363

PreviousNext