Thursday 15 May 2014

javascript - Struggling to make an object always follow the mouse in box2dweb -


I'm trying to learn how to use box2dweb and want to make an object (a circle in this case) While not only dragging the mouse all the time, this idea can be used for an air hockey type game where the circle is your paddle.

However, the wheel is not correctly connected to the mouse, instead it swings around that point where the mouse cursor and if the distance objects have a mouse cursor, then behaves like a distance .

I can not tell what I am doing, but I am still new to it, so any help would be appreciated.

You can see the code (depending on the demo code) so far:

< P> It was managed to understand, my problem was a misunderstanding of the difference between the mousezage definition target and the mousezheng target. I need to set the definition goal in the center of the ball, not the mouse cursor. Once I did it that it worked perfectly.

No comments:

Post a Comment