Problem with ball trajectory in breakout

Get help using Construct 2

Post » Sat Mar 31, 2012 9:45 pm

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.
B
15
S
2
G
3
Posts: 45
Reputation: 2,638

Post » Sat Mar 31, 2012 10:01 pm

How about if you use "Set angle" instead of "Set bullet angle of motion"?
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sat Mar 31, 2012 10:45 pm

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!
B
15
S
2
G
3
Posts: 45
Reputation: 2,638

Post » Sat Mar 31, 2012 11:22 pm

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.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452


Return to How do I....?

Who is online

Users browsing this forum: agittm, mercuryus, mystazsea and 13 guests