How do I make phusics impulse depending the angle of collisi

Get help using Construct 2

Post » Sat Mar 29, 2014 10:10 pm

Here is the thing a round object is falling. You can click anywhere and a star appears. If the star touches the objects it is projected up on the y axis.

I would like the object to be projected depending of the angle between the star and the center of that said object. Because when the object collides with the star it's always projected perfect on the y axis.

Do you have any formula?
B
13
S
4
G
1
Posts: 241
Reputation: 1,724

Post » Sat Mar 29, 2014 10:20 pm

Code: Select all
angle(object.X, object.Y, star.X, star.Y)+180

Should give you the opposite angle of collision with another object. Put that on a "on collision" event
It won't take into account the shape of the objects, so it should be used to simply move the "object" in the opposite direction of the "star"
B
84
S
22
G
15
Posts: 1,039
Reputation: 15,249

Post » Sun Mar 30, 2014 1:06 am

Thanks. The formula seems strange but i will try it asap.
B
13
S
4
G
1
Posts: 241
Reputation: 1,724


Return to How do I....?

Who is online

Users browsing this forum: purplemonkey and 8 guests