Workshop › Doodle Jump-style Climber › Step 9 of 24

Platforms

What we are doing

Six green platforms, one above the other, in a list. They are only drawn for now; the player falls through them.

```js
const platforms = [
  { x: 170, y: 500, w: 60, h: 12 },
  { x: 50, y: 410, w: 60, h: 12 },
  { x: 250, y: 320, w: 60, h: 12 },
  { x: 120, y: 230, w: 60, h: 12 },
  { x: 290, y: 140, w: 60, h: 12 },
  { x: 30, y: 60, w: 60, h: 12 },
]

  ctx.fillStyle = '#16a34a'
  for (const p of platforms) {
    ctx.fillRect(p.x, p.y, p.w, p.h)
  }
```

What it means

Your turn

  1. Under player, write the platforms list.
  2. In draw, after the background, draw the platforms.

Skills: Arrays and objects

All steps

  1. The jumper
  2. Draw again and again
  3. Gravity
  4. Bounce
  5. Steer left and right
  6. Through the sides
  7. Half here, half there
  8. Touch steering
  9. Platforms
  10. Land on platforms
  11. A camera that follows
  12. Lines on the wall
  13. How hard should it be?
  14. Endless platforms
  15. Miss and fall
  16. Play again
  17. Tap to play again
  18. Score is height
  19. Best score
  20. Kinds of platform
  21. Moving platforms
  22. Traps
  23. It breaks!
  24. Build it yourself: springs