Workshop › Hangman › Step 19 of 36
The gallows
What we are doing
Three more lines finish the gallows: the post, the beam and the short rope.
```js
function draw() {
// ...
line(40, 270, 220, 270)
line(80, 270, 80, 50)
line(80, 50, 170, 50)
line(170, 50, 170, 90)
```
What it means
- The post goes up from the ground at x = 80 (y shrinks going up).
- The beam goes right from the top of the post.
- The rope hangs down from the end of the beam to y = 90, where the head will be.
Your turn
In draw, under line(40, 270, 220, 270), write the three lines. Press Run.
Skills: Drawing on a canvas
← Draw a line The first miss: a head →
All steps
- A list of secret words
- The canvas and the pen
- Paint the paper
- A function that draws
- Pick a random word
- Write the word
- Hide it behind blanks
- Remember the guesses
- Draw again and again
- A guess
- Guess with the keyboard
- Only letters count
- Count the misses
- The same letter twice is free
- Six misses at most
- Show the misses
- List the wrong letters
- Draw a line
- The gallows
- The first miss: a head
- Body, arms and legs
- The parts in a list
- Losing
- Winning
- Show the word you missed
- The end message
- Play again
- Never the same word twice
- A winning streak
- Remember the best streak
- Where each key goes
- Draw the keys
- Center the last row
- Keys that remember
- Tap a key
- Build it yourself: a hint button