A Python-based gravity simulator powered by Pygame. This interactive simulation helps you visualize and understand how gravitational forces between objects interact ๐ in a two-dimensional environment.
- Add and interact with multiple balls representing celestial objects ๐ช.
- Real-time physics simulation including gravity and collision effects โก.
- Adjustable simulation speed โฉ.
- Resizable window with dynamic boundary updates ๐ฅ๏ธ.
- User-friendly control panel to manage simulation features ๐ฎ.
- Pastel-colored balls for a visually pleasing experience โจ.
- Excellent performance with smooth animations and updates ๐.
To install the necessary dependencies for this project, simply run:
pip install -r requirements.txt
Once you have installed the required package and have a release of python that supports pygame (3.10 works), run the main.py
script to execute the Gravity Simulator.
python3 main.py
When the simulation window opens, you can interact with the balls using your mouse ๐ฑ๏ธ. You can also use the top menu bar to perform various actions:
- Add Ball: Click this button to add a new ball to the simulation. The new ball will be placed at an available location.
- Change Bound: Toggles boundary visibility and updates boundary constraints when the window is resized.
- Pause: Use this button to pause or resume the simulation.
You are welcome to contribute to this project by submitting pull requests with new features, optimizations, or bug fixes. If you encounter any issues, please report them through the GitHub issue tracker, and we will address them as soon as possible.
This project is licensed under the MIT License. See LICENSE for more information.
Enjoy exploring the wonders of gravity through this amazing simulation!
This cost a lot of GPT Tokens lol