How do I predict the physics?

Get help using Construct 2

Post » Sat Jun 21, 2014 4:48 am

Hi Guys,

Is there any way possible to predict the happening physics. Like, If i shoot a ball from the left side to a basket in the right side, it may or may not hit. So, I want to predict if it is going to hit the basket before it hits, so that i can create an animation to the basket. Or if it is going to miss, I want to create some missing animation.

Now I know that a easy way is to create a invisible sprite around the basket and when the ball collides the invisible sprite, start animation. But physics does not happens in the same speed, so i need to check if it can be done some other way??

Is this possible??
Image
B
32
S
7
Posts: 197
Reputation: 2,537

Post » Sat Jun 21, 2014 5:53 am

What do you mean with "physics don't happen in the same speed"?

In any case, another way of doing it would be shooting an invisible ball with the same physics properties as your actual ball a little before, in the same conditions (speed, angle, etc), and check if that one hits.

The other way would be doing the actual calculations yourself, but that defeats the purpose of having a physics engine.
B
6
S
2
Posts: 79
Reputation: 608

Post » Sat Jun 21, 2014 6:22 am

monitz87 wrote:What do you mean with "physics don't happen in the same speed"?


I may hit the ball in different speed. Sometimes it hits quickly and some times it hit very slowly based on the angle.
Image
B
32
S
7
Posts: 197
Reputation: 2,537

Post » Sat Jun 21, 2014 4:54 pm

Nevermind I achieved with the same procedure but with some extra events.... Thanks anyways
Image
B
32
S
7
Posts: 197
Reputation: 2,537


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests