plugins - Canvas | Bouncing balls within a container (with gravity and collisions and background-images on the balls)

admin2025-06-02  3

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.

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.

Share Improve this question edited Feb 25, 2019 at 10:56 fuxia 107k39 gold badges255 silver badges461 bronze badges asked Feb 25, 2019 at 10:08 Jason Is My NameJason Is My Name 3782 gold badges7 silver badges21 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

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.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748868837a314394.html

最新回复(0)