How do I ... get the right reflection angle on collision

Get help using Construct 2

Post » Fri Jul 18, 2014 6:16 am

Hi.

Checking out my game "Superball" I think about to replace the inbuild physics behavior with a simple bouncing behavior (in fact of performance).
Therefore i just need to get the reflection angle on collision of the ball with an object (collision polygon).

How do i get the angle of the hit polygon :?:

Image
Image Image Image
B
42
S
22
G
15
Posts: 372
Reputation: 12,215

Post » Fri Jul 18, 2014 7:31 am

If you give the object the bullet behavior and set it to 'bounce off solids', then the angle is calculated for you.
Is this what you mean.

Attached quick .capx just in case. Click on gun to shoot. Needs r175.
You do not have the required permissions to view the files attached to this post.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
132
S
29
G
81
Posts: 5,329
Reputation: 56,657

Post » Fri Jul 18, 2014 7:35 am

What behaviour are you using?
Bullet behaviour has gravity and bounce of solids, so it should be able to do it for you..

Other ways would be to use sprite.angle or the MovingAngle of the behaviour..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Jul 18, 2014 7:52 am

Thank you both for this quick answer - bullet behavior is the trick - I'll give it a try!
Image Image Image
B
42
S
22
G
15
Posts: 372
Reputation: 12,215


Return to How do I....?

Who is online

Users browsing this forum: duke2704, RetrocadeMedia, sebrosen, Yahoo [Bot] and 32 guests