Make an object bounce?

Get help using Construct 2

Post » Sat Oct 08, 2011 8:40 am

It goes into the ends of the walls if I reposition them in your example. Try it.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,390

Post » Sat Oct 08, 2011 9:40 am

Are you using your bullet behavior instead of my Custom Movement behavior? The reason I ask is because Iv been trying to recreate this problem with no luck. Maybe it is just a bug with the Bullet behavior.
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Sat Oct 08, 2011 11:01 am

Create a square wall_x in the middle of the field. Whenever the ball hits the top it goes right through.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,390

Post » Sun Oct 09, 2011 1:22 am

Hello sqiddster

Did you remember to give the wall in the middle a solid behavior? Because it is working for me. Here is my example:



Bouncing ball wall in the middle example


Maybe I'm misunderstanding your issue. If I am could you post a capx. for me to look at? Wink2011-10-09 01:29:38
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Sun Oct 09, 2011 3:08 am

Look closely at the bounce when the ball hits the top or bottom of the middle wall. It is certainly wrong.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,390

Post » Sun Oct 09, 2011 6:06 am

OK, now I see the problem. In the example above I made a wall taller than the layout size so I couldn't recreate the problem. lol This time I just made a small box in the middle. In my first example I set everything so that the ball would bounce as if it were inside a box like in a breakout game.

Now the problem is figuring out how to accurately make the ball bounce of a box in the center from all angles. I will play around with it and see if I can figure it out. This will require a different technique in other words "I will have to think outside the box." LOL

Anyway here is the capx. of the problem:


Bounce Problem


If anyone has any ideas your help would be appreciated. This one has me stumped.
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Mon Oct 10, 2011 7:52 am

Has me stumped too :)
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,390

Post » Mon Oct 10, 2011 7:19 pm

It can be solved by first moving horizontally then vertically, and reversing the horizontal or vertical motion when it overlaps a wall.

http://dl.dropbox.com/u/5426011/c2/bounce.capx
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Mon Oct 10, 2011 8:09 pm

Thank you very much R0J0hound for your great solution. I was going about it all wrong. It would have taken me forever to get it rite. Thanks again    Wink2011-10-10 20:13:16
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Mon Oct 10, 2011 9:29 pm

Looks good to me ;)
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,390

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: Megavolt, mnashwan, shinkan, stylie1, tarek2 and 18 guests