Dynamic objects can be moved primarily by using forces. Moving objects by setting their position manually is not recommended because you can easily miss an object collision this way. However, you can set an object's position at the start of your game to adjust the initial object location.
For this recipe, you'll need a dynamic object with a nonzero mass and density:
local body_def = box2d.BodyDef() body_def.type = 'dynamic' body_def.position = Vec(0,0) body_def.angle = 0 local body = world.createBody(body_def) local shape = box2d.CircleShape() shape.radius = 1 local fixture_def = box2d.FixtureDef() fixture_def.shape = shape fixture_def.density = 1.5 fixture_def.friction = 0.3 fixture_def.restitution = 0.2 local fixture = body.createFixture(fixture_def)