[Solved]Perfect 90 Degrees

Get help using Construct 2

Post » Tue Apr 23, 2013 1:36 pm

I am trying to get a perfect and consistent 90 degree bounce angle at any speed...
I have put together two tests to show the issue I am having:
bulletbouncetest.capx

lower speeds remain more accurate for more bounces and the higher the speed the lower the accuracy. Am I doing something wrong? Shouldn't these tests render the same results each time even if they weren't pixel perfect?
Alexixiv2013-04-23 20:11:49
B
6
S
3
G
1
Posts: 102
Reputation: 1,379

Post » Tue Apr 23, 2013 5:26 pm

Is there another simple way to accomplish this? an example would be great! Thanks!!
B
6
S
3
G
1
Posts: 102
Reputation: 1,379

Post » Tue Apr 23, 2013 6:00 pm

If the built in bounce isn't working (it should only work at a perfect 90 if you are moving in a straight line and hitting a 45 degree angled object) then you can test for on collision and then manually set the angle to +/- 90 degrees...
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Tue Apr 23, 2013 6:20 pm

Could you look at the example that I have and add your suggestion to it, I cannot seem to get that to work for me...
B
6
S
3
G
1
Posts: 102
Reputation: 1,379

Post » Tue Apr 23, 2013 7:20 pm

Ok, I got something close enough to a solution that I can continue on with my project. It still messes up over speed of 1900, but that is enough of a speed range to work with.

I started rounding the angle of the bullet motion to the nearest 90 degrees and the x/y position to the nearest multiple of 64 and made sure all my objects and origin points were positioned accordingly and voila.

Special thanks to Mipeyon this postfor the rounding formula.
B
6
S
3
G
1
Posts: 102
Reputation: 1,379

Post » Tue Apr 23, 2013 9:41 pm

I'm guessing the collision is detected on a tick where the ball is not right at the center of the line. Every collision moves the ball a little further from the center, until the ball breaks free. Your solution is as good a way as I can think of to combat the issue.
B
44
S
13
G
7
Posts: 338
Reputation: 10,379


Return to How do I....?

Who is online

Users browsing this forum: Artpunk, Axiomaltd, nicklowkcmagic, OddConfection and 19 guests