r/processing • u/sebastianpatrickk • Apr 01 '24
Beginner help request How to create these bouncing ball simulations is a good workout for them. Or use a game engine like Unity or Godot.
Hey everyone, lately I've noticed that these boucing ball simulations are mega popular on social media. And I would also like to start creating them, I started with pygame but I found out that pygame doesn't have such high quality rendering, so I kept looking and came across processing. And now I'm thinking about whether to learn processing or rather try Unity or Godot. And if someone could help me create the first simulation or at least tell me where to start. Thank you all for the advice and help
https://www.youtube.com/shorts/1oLiJMjTvc8
3
u/sebastianpatrickk Apr 01 '24
Sorry, I made a typo, I wanted to write processing instead of workout in the title
5
u/LateCommunication383 Apr 01 '24
There are some bouncing balls examples on the Processing site.
4
u/RajRaizada Apr 01 '24
Use p5play. It’s p5js with added sprites and a built-in physics engine. Here’s an example of bouncing balls in a Galton board simulation that I wrote. You can check out the code on GitHub. It’s simple code, as the physics engine takes care of all the bouncing for you.
https://rajeevraizada.github.io/Galton_board_p5play/
2
u/Wootai Apr 01 '24
Unity or Godot will have built in physics engines you can use. But they are game engines not really built for visualizations.
Processing, is built for this kind of visualization, however you will have to build all the physics simulation yourself.
2
u/MGDSStudio Apr 01 '24
Use Box2D for Processing. This library has examples in Processing IDE but this library is reative difficulty for beginners.
When I was creating my videogame (it uses Processing with Box2D for physics simulation) I was learning Box2D using tutorials for LibGDX.
The Libraries are same but there was more information for LibGDX (Java Framework).
2
u/[deleted] Jun 26 '24
you can use p5js directly.
1
u/mikeyjgames Apr 22 '25
Its mostly in python, pygame library
1
u/sacredgeometry Apr 01 '24
Investigate rigid body dynamics.
Implement a system based on those principals.
?????
Profit
Sorry I am not sure what the choice of library you use to render has to do with it? Unity and godot have their own physics engines. So I guess it would be less work to implement as it would be more about instantiating the objects with rigid bodies and the right settings but if you just want to render out a 2D example all four of those libraries/ frameworks will do exactly the same render at exactly the same quality.
Ergo: its probably pebcak