Workshop › Doodle Jump-style Climber › Step 12 of 24
With a plain background you cannot tell you are climbing. Faint lines every 40 world pixels, like lines on a wall, slide down as the camera goes up.
```js
// Faint lines fixed to the world, so you can see the climb even between platforms.
ctx.fillStyle = '#e2e8f0'
for (let y = ((-cameraY % 40) + 40) % 40; y < canvas.height; y += 40) ctx.fillRect(0, y, canvas.width, 1)
```-cameraY modulo 40.% 40 of a negative number is negative in JavaScript; adding 40 and taking % 40 again makes it 0 to 39.In draw, under the background, write the comment and the two lines.
Skills: Drawing on a canvas
← A camera that follows How hard should it be? →