3 ms·
> 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.
by __ryan__ 5y 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.
- agys 5y agoWhile setInterval works, requestAnimationFrame(time) is probably better suited for animation purposes.
- bryanbraun 5y agoThat's a good callout. I just updated it to add more detail there.