Learn by Building Workshop Skills GitHub Türkçe Workshop › OutRun-style Racer › Step 10 of 44
Kerbs and a center line What we are doing Race tracks have red and white kerbs at the edges and a dashed line in the middle. Both are trapezoids too: the kerb a
little wider than the road and painted before it, the center line very thin and painted after it.
```js
const light = Math.floor(index / 3) % 2 === 0
quad(light ? '#f8fafc' : '#dc2626', near.x, near.y, near.w * 1.15, far.x, far.y, far.w * 1.15)
quad(light ? '#6b7280' : '#646b75', near.x, near.y, near.w, far.x, far.y, far.w)
if (light) quad('#f8fafc', near.x, near.y, near.w * 0.03, far.x, far.y, far.w * 0.03)
```What it means
The kerb is 1.15 times as wide as the road, white on light segments and red on dark ones. The road covers its middle.
On light segments only, a white line 0.03 times the road's width is painted on top: light and dark take turns, so the
line is dashed.
Your turn In the second loop, write the kerb line above the road quad and the center line below it.
Skills: Drawing on a canvas
← Paint from far to near Striped grass →
All steps Sky and ground Draw again and again Perspective One piece of road A road made of segments Where we are on the track The road ahead Stripes Paint from far to near Kerbs and a center line Striped grass Moving is one number Which keys are down? The gas pedal Brake, coast and a top speed Your car Speedometer A pedal for phones Move the camera sideways Steering No turning on the spot The grass is slow Steering by touch A track with curves Bend the road No jumps in the curve Which segment am I on? Curves pull you outwards Other cars Distance on a loop Cars that shrink with distance Traffic moves Rear-end crash Counting laps Show the lap A lap timer Show the time Best lap Show the best lap Racing or finished The finish line Finished! Race again Build it yourself: beat the clock