Workshop › Lunar Lander › Step 7 of 31

Two feet

What we are doing

The lander stands on two small feet, 9 pixels left and right of its middle. We will use the same numbers to check whether it touches the ground.

```js
const FEET = 9 // the feet are this far left and right of the middle, and 10 below it

  ctx.fillRect(-FEET, 8, 2, 2)
  ctx.fillRect(FEET - 2, 8, 2, 2)
```

What it means

Your turn

  1. Under const STEP = ... write const FEET = 9 with its comment.
  2. In drawLander, between ctx.fill() and ctx.restore(), write the two feet.

Skills: Drawing on a canvas

All steps

  1. Random hills
  2. Draw the hills
  3. A landing pad
  4. The height at any x
  5. The lander
  6. Draw it around its own middle
  7. Two feet
  8. The game loop
  9. Moon gravity
  10. Around the sides
  11. Flying or not
  12. Touching the ground
  13. Remember held keys
  14. Tilt
  15. The engine
  16. A flickering flame
  17. Fuel
  18. Touch controls
  19. Landing or crashing
  20. Fly again
  21. Landed or crashed?
  22. Readouts
  23. Levels
  24. Score
  25. Next level or new game
  26. A narrower pad
  27. A high score
  28. Burst into pieces
  29. Pieces fall and fade
  30. Draw the wreck
  31. Build it yourself: wind