Dust
Swarm behavior experiments with RxJs
Animation 1
Goal: Animate several seahorses over an interval.
Key points:
- range() used to create N divs
- interval() used to create FPS
Animation 2
Goal: Scare a seahorse with a click. Move her to a safe distance away.
Key points:
- last() used with takeWhile() to only update state store at end
- scan() re-emits on each emission. reduce() only emits after last emission (take()).
- CustomEvent can bridge streams
- State store passed between streams
- Random movement vector, collision detection