Hot answers tagged

2

Do not use boxes for this kind of terrain. There are numerous problems that arise with using boxes, namely "catching" of objects on the intersections between the boxes. Box2D provides Edge Shape (line) primitives as well as a Chain Shape that far better suites your purpose. From the linked manual: // This a chain shape with isolated vertices b2Vec2 vs[4]; ...


1

Ok, after 4 hours of searching finally I found the mistake. Problem was with the sprite origin. Here's the line that was necessary (staticBody is the body around other bodies will rotate) tmpSprite.setOrigin(staticBody.getPosition().x / 32 + tmpSprite.getWidth() / 2, staticBody.getPosition().y / 32 + tmpSprite.getHeight() / 2); And here's ...



Only top voted, non community-wiki answers of a minimum length are eligible