Parabola/Tracjectory tracing with Physics / Box2D

Get help using Construct 2

Post » Sun Mar 31, 2013 12:09 pm

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

Post » 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
41
S
9
G
4
Posts: 100
Reputation: 6,211

Post » 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

Post » 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.
Image
B
27
S
9
G
5
Posts: 487
Reputation: 11,939

Post » 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

Post » 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

Post » 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
79
S
24
G
54
Posts: 4,754
Reputation: 40,771

Post » 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
Can you help me please

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

thanks a lot
B
4
Posts: 4
Reputation: 218

Post » Thu Nov 19, 2015 3:35 pm

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

thanks,
B
85
S
31
G
23
Posts: 384
Reputation: 19,092

Post » 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.
Image
B
29
S
11
G
2
Posts: 261
Reputation: 5,019

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests