Click the green flag and watch. Play around with the sliders if you like.
@Santiago020267's original project is very cool, but I didn't quite understand the code, so I renamed the variables and reworked the code a bit in order for me to wrap my head around it. As a bonus you can now change the number of balls and frequency difference between the balls.