Ball escaping beyond solid wall - inputs

  • As some of you know(?) I am working on a breakout clone (with my own twists)..

    The ball has bullet behavior, and the walls on top, left side and right side is "solid".

    Once in a blue moon the ball get sneaky and bounce through the wall and escape. Because of that it happens so seldom it is hard to "check bug" it.

    So I would like to have your input on approach to "cure" this.

    I wonder if it would be a good idea to identify the ball x and y position, and verify with the play area and if it is outside of the play area, adjust the position of the ball to be just inside the play area?

    Would you do this or something else?

    If you want to see the game itself it is here.

  • Well a couple of questions.

    1. do you manually move the ball with a set.xy at any point.

    If you do I suggest examining these.

    2. Is your ball only moving due to bullet instructiosn.

    If yes. no worries it's a good step :)

    3. Thicken you walls. At certain velocity the ball can move fast enough on the logic level to pass through part of a thin wall.

    Thicken the wall. If you need to hide the thick wall then put an image to hide the thicker wall.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • jayderyu

    Oh yes, thicker walls, why not. I could always make them invisible. But I wonder about walls beyond the layout, will they still function as solids even if it is outside? Because of having thick walls inside the window/layout make the playarea smaller. ;)

    Ah well, I will experiment!

    Bullet movement, yes. If I don't change my mind entirely. :) (due to other things)

    Thank you!

  • You can move the walls outside the layout. The layout only is only a virtual definition of the game play size. In theory you can unbind the visual lock and see out side. So there isn't aproblem if your walls exist outside the layout.

  • I forgot to update, jayderyu, sorry! It worked nicely, thank you.

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