Hacker News new | ask | show | jobs
by __ryan__ 1762 days ago
> To animate the wave in JavaScript, we can use setInterval to repeatedly call our drawRipple() function, and pass in a timestamp to adjust the wave position.

You described generating a ripple still-frame then completely glossed over the “animation” part.

2 comments

While setInterval works, requestAnimationFrame(time) is probably better suited for animation purposes.
That's a good callout. I just updated it to add more detail there.