Workshop › Doodle Jump-style Climber › Step 6 of 24
Like the real game, leaving one side brings you back on the other. When the player's middle goes past an edge, it jumps by the width of the canvas.
```js
// Walking off one side brings you back on the other.
if (player.x + player.w / 2 < 0) player.x += canvas.width
if (player.x + player.w / 2 > canvas.width) player.x -= canvas.width
```player.x + player.w / 2 is the player's middle.In update, under the steering lines, write the comment and the two lines.
Skills: Game states
← Steer left and right Half here, half there →