diff --git a/src/game/physics/map_simulation.cpp b/src/game/physics/map_simulation.cpp index 8e756f2..08cdd84 100644 --- a/src/game/physics/map_simulation.cpp +++ b/src/game/physics/map_simulation.cpp @@ -49,11 +49,11 @@ void MapSimulation::constructSquareObstacle(float minX, float minY, float maxX, { b2BodyDef bodyDef; bodyDef.type = b2_staticBody; - bodyDef.position.Set((maxX - minX) / 2.f, (maxY - minY) / 2.f); + bodyDef.position.Set((maxX + minX) / 2.f, (maxY + minY) / 2.f); b2Body *body = world->CreateBody(&bodyDef); b2PolygonShape shape; - shape.SetAsBox(maxX - minX, maxY - minY); + shape.SetAsBox((maxX - minX) / 2.f, (maxY - minY) / 2.f); b2FixtureDef fixtureDef; fixtureDef.shape = &shape;