Are there any tutorials about Breakout using Physics?

Get help using Construct 2

Post » Wed Mar 16, 2016 10:22 am

Hello,

I have been looking for sometime now for a tutorial that shows the ball movement using Physics. I found a general Breakout tutorial but it doesn't use Physics. I tried myself to do it a few times but I can't figure out how to keep the ball moving using Physics and control the ball using the paddle.

Does anyone know anything about that, please?

Thank you very much in advance.
B
19
S
7
Posts: 161
Reputation: 1,751

Post » Thu Mar 17, 2016 9:06 am

Bump, still looking for a proper method to do a breakout clone using physics.

What I have so far is that the ball has physics with elasticity set to 1 and all other options set to 0; Immovable is No, Collision is Circle and Prevent Location is set to No. The Bullet Physics is set to enabled too.

Unfortunately I can't seem to control the ball with the paddle at all. The bounce is always on a 45 degrees angle. The "hacky" way I did is make the paddle's collision have an angle rather than being a straight line. But it still feels weird and off.

Also when the ball hits a vertical wall on its way upwards, it sometimes instead of deflecting to an angle upwards, it bounces off with an angle towards the paddle (even though it was on its way up to the upper wall).
The walls have all settings to 0 except Elasticity to 1 and immovable to Yes.

Any ideas how to resolve these issues please? Any help would be appreciated.
B
19
S
7
Posts: 161
Reputation: 1,751

Post » Thu Mar 17, 2016 10:52 am

To be honest, I can't remember coming across such an example as the majority just use the bullet behavior, which is much easier and has a much less overhead, especially if targetting mobiles.

If you can't find anything via search - either through forum search or Google - then you may be out of luck.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
86
Posts: 5,415
Reputation: 59,516

Post » Thu Mar 17, 2016 10:56 am

For some reason I read before somewhere that using the Physics was better than the bullet behavior. If it is better to use the bullet behavior then I could switch over to that.

But two other problems arise:

1- With high speeds, the ball sometimes just ignores all collisions and goes through solids, anyway to counter this?

2- How can I change the direction of the bounce depending on the collision location between the paddle and the ball? I tried doing Set Angle of Motion to "Ball.X - Paddle.X / Paddle.Width" and it didn't quite work at all. Any idea how to make it that the left third of the paddle sends the ball slightly to the left, the right third of the paddle sends the ball slightly to the right and the middle third of the paddle deflects the ball 90 degrees?

3- One last question but may seem random (but it isn't), I am trying to use a bullet behavior on an object that acts as a projectile. When that projectile gets a target (let's say a prick), I set its angle of motion to (projectile.x, projectile.y, target.x, target.y) and have the Bullet Behavior property speed set to 400 (no change of angle as angle of motion). But the projectile doesn't rotate to face its target. I tried to use Rotate towards Position and it isn't working, any other solution for this?

Thank you very much for your time and efforts!
B
19
S
7
Posts: 161
Reputation: 1,751


Return to How do I....?

Who is online

Users browsing this forum: AllanR, brunopalermo, ST314, TheRealDannyyy, tunepunk and 23 guests