This project created with the help of Python's Pygame module is a basic simulation of the solar system, utilizing Newton's second law of motion and Newton's law of universal gravitation, together with the real properties of the planets and the Sun alone.
In my Python journey for CS310, I got hooked on space stuff and when it came time for a project, i stumbled upon this awesome youtube video Tech With Tim's Python Tutorial for Planet Simulation , this one fueled my project. Python and space - my perfect combo. Newton's laws? Yeah, they made it into my cosmic code. who knew Python could take me to the stars?
- Distances are to scale, sizes are not to scale.
- Calculations are done regarding Newton's laws with actual properties of the celestial bodies (Retrieved from NASA's fact sheets)
- Simple Planetary motion, comets and twinkling stars.
- Smooth background music
- P Key: Pause/Unpause the simulation
- M Key: Mute/Unmute background music
- I Key: Toggle information display for the selected planet
- 1-8 Keys: Select specific planets
- Q Key: Quit the simulation
- Download the project, go to the project directory , install pygame and you are good to go.
- Start the program at your IDE's terminal (or command prompt) by executing
python main.py
All assets used in this project are copyright-free.
- Background music is retrieved from Mobcup. Credit to: SamuelFrancisJohnson. You may find it here.
- Celestial bodies' images that appear on bottom-left corner are retrieved from NASA.
- Celestial bodies' astronomical symbol images are retrieved from Wikipedia under Creative Commons License. Find particular images: Sun, Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune. Converted to JPG and edited on MS Paint for black background - white foreground change.