Workshop › Doodle Jump-style Climber › Step 23 of 24
Landing on a trap breaks it: no bounce, and the broken platform falls away. The player keeps falling, maybe onto a real platform below.
```js
if (p.broken) p.y += 5 // a broken platform falls away
if (!p.broken && over && oldBottom <= p.y && bottom >= p.y) {
if (p.kind === 'breaking') {
p.broken = true
continue
}
```!p.broken).continues to the next platform instead of bouncing.update, write the falling line first.!p.broken && and the trap block.Skills: Collision detection, Game states
← Traps Build it yourself: springs →