Workshop › Missile Command-style Defense › Step 10 of 35
Each missile is drawn as its smoke trail: a red line from where it started to where it is now.
```js
ctx.lineWidth = 2
ctx.strokeStyle = '#f87171'
for (const m of incoming) {
ctx.beginPath()
ctx.moveTo(m.sx, m.sy)
ctx.lineTo(m.x, m.y)
ctx.stroke()
}
```lineWidth and strokeStyle are the thickness and color of lines (fillStyle is for filled shapes).beginPath starts a new line, moveTo puts the pen at the start, lineTo draws to the missile, stroke paints it.In draw, under the base's fillRect line, leave an empty line and write the trail lines.
Skills: Drawing on a canvas
← Missiles on their way Impact →