Workshop › Hangman › Step 20 of 36
The first miss draws the head: a circle hanging from the rope. A circle is a path too, made with arc.
```js
function draw() {
// ...
line(170, 50, 170, 90)
ctx.strokeStyle = '#1f2937'
ctx.lineWidth = 4
if (wrong > 0) {
ctx.beginPath()
ctx.arc(170, 110, 20, 0, Math.PI * 2) // head
ctx.stroke()
}
```if (wrong > 0) { ... } runs the block only after at least one miss.arc(x, y, radius, start, end) draws part of a circle around (x, y). From angle 0 to Math.PI * 2 is a whole
turn, so it is a full circle. Its top is at 110 - 20 = 90, the end of the rope.In draw, under line(170, 50, 170, 90), write the new lines. Press Run, click the game and try a wrong letter.
Skills: Drawing on a canvas
← The gallows Body, arms and legs →