Workshop › Pong › Step 3 of 26
The net in the middle is a dashed line. We draw its first dash: a white rectangle 4 pixels wide and 15 tall, centered on the middle of the court.
```js
ctx.fillStyle = 'white'
ctx.fillRect(canvas.width / 2 - 2, 0, 4, 15)
```canvas.width / 2 is the middle (300); - 2 centers a 4 pixel wide dash on it.0 is the top; the dash is 15 pixels tall.At the very end, leave an empty line and write the two white lines. Press Run.
Skills: Drawing on a canvas
← A black court The whole net →