Impulse problem

Discussion and feedback on Construct 2

Post » Mon Aug 20, 2012 1:14 am

Hi

I have made this brick break game using phisycs.
http://ethemba.com/TOOLS/gamecenter/arkanoid/
http://ethemba.com/TOOLS/gamecenter/arkanoid/arkanoid.capx


To throw the ball you can use space or mouse click.
But sometimes the ball is not thrown. Usually the first time but sometimes later also.

I dont know why the impulse is not working sometimes and sometimes yes.

Has anyone an idea? Im doing something wrong?

Dont move the platform out of the walls because that part is not done yet. Im trying to figure how to control it.

Thank you very much
B
3
Posts: 27
Reputation: 904

Post » Mon Aug 20, 2012 2:48 am

I haven't looked at the capx because it uses a plugin I don't have but I'd guess it's because you're setting the ball to the mouse x, y coordinates before applying the impulse. Same problem as this thread:
http://www.scirra.com/forum/please-help-with-touch-events_topic54856.html
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,000

Post » Mon Aug 20, 2012 10:03 am

Thank you

I forgot about the plugins, sorry. But you are completely right.

I understand that the solution is to create a placeholder image (i have already search for it) without physics, and at the moment of launch destroy it and create in that position the physics object.

If the problem is the mouse position i supose that i must create the new object in the last position of the place holder to avoid use mouse.

Im going to try it. Thank you very much
B
3
Posts: 27
Reputation: 904


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 15 guests