0 Favourites

Problem with ball trajectory in breakout

  • So, as some of you might have already seen, I'm working on a breakout style game as my first project. It was working fine when I had the ball being released automatically, but I set it so that the ball follows the paddle at first and is only released after the space bar is pressed. Even though the process seem the same, now when the ball is released, it always goes horizontally instead of the angle I specified. I basically have the events set like this:

    If variable "Played" is 0, when Spacebar is pressed;

    Set Playing to 1;

    Set angle of motion of the ball to something between 45 and 135;

    Set ball's movement speed to 300;

    I see nothing wrong with it, yet this always happens. And then, if I have the paddle next to a wall, the ball bounces up.

    Here's a link for the exported game. And one for the .capx.

    Thank you for the help.

  • How about if you use "Set angle" instead of "Set bullet angle of motion"?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Well, what do you know, it worked!

    I thought that since I was using a bullet movement, the action to modivy that movement would be in the bullet group as well. I didn't even see that one, so convinced was I that the bullet one was right.

    Now I'm curious as to why "Set bullet angle of motion" makes it go horizontal.

    Anyway, thanks a lot!

  • If you check the bullet properties, you'll see that "Set angle" is set to "No". If it was set to yes, the bullet behaviour could change the objects angle. Since it's set to no, "bullet angle of motion" does nothing, and the object simply follows the object angle instead, which is right by default.

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