A captivating 2D simulation of planets orbiting a central star, built with Pygame. This project visualizes gravitational forces and orbital mechanics in a simple yet engaging way.
Realistic Orbital Mechanics: Planets attract each other based on Newton's Law of Universal Gravitation.
Scalable Simulation: Adjust SCALE and TIMESTEP to explore different orbital behaviors.
Interactive Visualization: Watch planets trace their paths in real-time.
Distance Tracking: Displays the distance of each planet from the sun (in kilometers).
Customizable Planets: Easily add or modify planets with different masses, radii, and colors.
Clone the repository:
git clone https://github.com/Millsjr/Planet-Orbit-Simulator.git cd Planet-Orbit-Simulator
(Note: Replace https://github.com/Millsjr/Planet-Orbit-Simulator.git with your actual repository URL if different, and Planet-Orbit-Simulator with your repository name.)
Install dependencies: This project requires pygame. If you don't have it installed, you can install it using pip:
pip install pygame
Run the simulation:
python your_script_name.py
(Replace your_script_name.py with the actual name of your Python file, e.g., main.py if you save the code as main.py)
Python
Pygame - A set of Python modules designed for writing video games.
(Consider adding a screenshot or a short GIF of the simulation running here to make your README more engaging!)
Add more planets (Jupiter, Saturn, etc.).
Implement user controls for zooming or changing simulation speed.
Display additional orbital parameters (e.g., orbital period).
Add collision detection between planets.
Implement a pause/play feature.
This project is open source and available under the MIT License. (Consider creating a LICENSE file in your repository if you haven't already.)
Feel free to explore, contribute, and enjoy the wonders of orbital mechanics!