Are there any tutorials about Breakout using Physics?

0 favourites
  • 4 posts
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • 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.

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)