I changed box2d example to spawn circles. But the physic looks wrong. For example, when the circle stops jumping, it is not on the rectangle, but is immersed in the rectangle.
solidRect(600, 100, Colors.WHITE)
.position(100, 412)
.registerBodyWithFixture(
type = BodyType.STATIC,
friction = 0.2
)
onClick {
val pos = it.currentPosLocal
circle(16.0)
.position(pos.x, pos.y)
.size(32,32) // does not affect
.registerBodyWithFixture(
type = BodyType.DYNAMIC,
friction = 0.5,
restitution = 0.5,
density = 0.2
)
}
Result Circle immersed in rectangle when using box2d in korge