# Function: smoothMotion()

> **smoothMotion**(`game`, `objects`): [`SmoothMotion`](../classes/SmoothMotion.md)

Defined in: ../debuff/packages/core/src/smooth.ts:96

Smooth drawing between fixed steps for the objects `objects` returns, read before every step.

```ts
const smooth = smoothMotion(game, () => [player, enemies, shots]);
// in render:
draw.sprite(img, smooth.x(player), smooth.y(player));
for (const e of enemies) draw.sprite(enemyImg, smooth.x(e), smooth.y(e));
// after moving something instantly:
smooth.snap(player);
```

## Parameters

### game

[`Game`](../classes/Game.md)

### objects

[`MotionSource`](../type-aliases/MotionSource.md)

## Returns

[`SmoothMotion`](../classes/SmoothMotion.md)
