How do I edit angles in bullet behavior.

Get help using Construct 2

Post » Sun Mar 06, 2016 11:17 am

Hello, in the bullet behavior, is there some way that bounce angles are the same as the angle of origin but reflected ?.

Currently the bullet mode takes into account the shape of the object, I want to disable that and that is the style angle pong, pong ball.

If the angle hits with 45 degrees, the new angle is 315 degrees.


This is what I want
Image

I want the angle is the same, but that is reflected in the impacts, without alteration of the angle.

I have read the documentation and I think the bullet behavior does not have this effect exactly, apparently the bullet behavior could vary the angle due to the shape of the object, then I want off that and get accurate reflected angle.

Please, sorry for my english.
B
30
S
13
G
21
Posts: 838
Reputation: 14,656

Post » Mon Mar 07, 2016 8:38 am

Did you check the bouncing bullets capx example? Is it similar to what you want?
If you want it like how light bounce off the mirror then that's that.
B
7
S
2
G
1
Posts: 42
Reputation: 1,144

Post » Mon Mar 07, 2016 5:37 pm

The default mode in behavior bullet is the mode of what would be the reflection of light?
If so, then yes, that is what I want, but this confuses me:

In the documentation of bullet behavior say this:

It will also calculate the angle of reflection to bounce off realistically depending on the object's shape and angle.

That's what I meant, It refers to the shape of the sprite? or the shape of the bounding box ?.
I want the shape of the object does not interfere, so I think you could get reflections as light.
B
30
S
13
G
21
Posts: 838
Reputation: 14,656

Post » Mon Mar 07, 2016 9:06 pm

Some quick experimentation with the example would show you that the bouncing behavior is based on the bounding box of the object.
Mistakes were made.
B
53
S
27
G
114
Posts: 1,699
Reputation: 64,446

Post » Mon Mar 07, 2016 10:26 pm

The bounce action of the bullet behavior should bounce according to the shape of both objects, aka their collision polygons.

You can approximate it with events like this:
how-do-i-replicate-the-span-class-posthilit-bounce-span-off-behavio_p1007866?#p1007866

In the case of a ray of light, you only need the angle on the object that's hit then the reflected angle would be 2*AngleOfSurface-angleOfMotion.
B
94
S
33
G
114
Posts: 5,359
Reputation: 73,779

Post » Wed Mar 09, 2016 10:58 am

R0J0hound wrote:The bounce action of the bullet behavior should bounce according to the shape of both objects, aka their collision polygons.

You can approximate it with events like this:
how-do-i-replicate-the-span-class-posthilit-bounce-span-off-behavio_p1007866?#p1007866

In the case of a ray of light, you only need the angle on the object that's hit then the reflected angle would be 2*AngleOfSurface-angleOfMotion.



Ok, thanks for the information, it will examine later.
B
30
S
13
G
21
Posts: 838
Reputation: 14,656


Return to How do I....?

Who is online

Users browsing this forum: JayH and 9 guests