Page 1 of 1

Body:applyForce - angle

Posted: Mon Nov 01, 2010 9:01 am
by Gru
I do not speak English, so I'll post the .love and image
Image

Re: Body:applyForce - angle

Posted: Mon Nov 01, 2010 9:26 am
by Robin
Please don't use fullscreen. It's very annoying and it didn't return to the normal resolution afterwards.

If I understand you correctly, the solution you seek requires trigonometry. Without looking at your code, something like:

Code: Select all

angle = body:getAngle()
body:applyForce(strength * cos(angle), strength * sin(angle))
As I said, I didn't look at your code and this is untested.

Re: Body:applyForce - angle

Posted: Mon Nov 01, 2010 9:56 am
by Gru
Thanks! you really helped me :awesome:
--sorry for the fullscreen