Workshop › Zelda-style Dungeon › Step 20 of 22

The stairs out

What we are doing

The stairs E are behind the locked door, in the last room. Standing on them wins: you escaped!

```js
    if (ch === 'E') {
      ctx.fillStyle = '#1c1917'
      ctx.fillRect(x + 4, y + 4, T - 8, T - 8)
    }

if (here === 'E') {
  state = 'won'
}
```

What it means

Your turn

  1. In the tile drawing, draw the stairs after hearts.
  2. In update, before the door, win on the stairs.

Skills: Game states

All steps

  1. A room
  2. The hero
  3. The game loop
  4. Walk
  5. Walls
  6. A touch pad
  7. Next room
  8. The sword
  9. Enemies
  10. Strike!
  11. They chase you
  12. They wander
  13. Ouch
  14. Blinking and hearts
  15. Keys and hearts
  16. A world that remembers
  17. The locked door
  18. A timer
  19. Game over
  20. The stairs out
  21. Best time
  22. Build it yourself: cleared rooms