Search found 6 matches
- Wed Nov 04, 2015 1:43 am
- Forum: Libraries and Tools
- Topic: windfield (easy box2d)
- Replies: 6
- Views: 7430
Re: [Library] hxdx (box2d wrapper)
This seems really handy. Nicely done.
- Tue Jun 23, 2015 12:39 am
- Forum: Support and Development
- Topic: Move towards mouse position using Box2d physics?
- Replies: 4
- Views: 3051
- Tue Jun 23, 2015 12:17 am
- Forum: Support and Development
- Topic: Move towards mouse position using Box2d physics?
- Replies: 4
- Views: 3051
Re: Move towards mouse position using Box2d physics
Apply a force the direction of the mouse. So using math.atan2 you get the angle between the body and the mouse then all you have to do is apply a force to the body. Using sin and cos times a force. Then apply them to y and x respectfully. I'm sorry that I can't type any code for you. I'm on a phone...
- Mon Jun 22, 2015 10:26 pm
- Forum: Support and Development
- Topic: Move towards mouse position using Box2d physics?
- Replies: 4
- Views: 3051
Move towards mouse position using Box2d physics?
When the left mouse button is held down, how would I have a Box2d object move towards the position of the mouse?