This is not related to WordPress. Maybe your Question would get better answers at other more javasript related stack exchanges.
Anyways: I searched for “bouncing balls” at codepen and found this piece. I guess adding background images would be no problem with this as a foundation.