I am really struggling to find some code that will help me create a canvas (will be positioned absolutely behind an element so I don't require any input from users) that I am able to place background images on balls (predetermined number of balls '10'). The balls need to bounce off the walls and each other while under the effect of gravity, eventually having the balls settle stacked up stationary is the dream.

Can anyone help me with this? Either using a WordPress free plug-in or direct me to some open source code that does this?

I have been through hundreds of articles and examples of code but none seem to apply to my use-case.

I appreciate this is quite a code heavy question failing the plug-in approach, however I am unable to write questions on stack-overflow even though I don't have any questions with a negative score (think the algorithm is broken for my account.)

Thanks, Jason.


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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.