Another fun challenge I've given myself. I absolutely love creating physics simulations, so I'm going to attempt to make a more controllable version of my previous planet simulation game. The intention is to allow the user to make planets and see how they behave under each other's gravitational influence. I don't intend to add any collision physics, however I may decide to code some in at some later date.
This is a sandbox game in which a player may place any planets they wish to. The player may choose a mass, direction and speed prior to placing the planet. The player may also choose the color of the planet they play before placing it. Once a planet is placed, it will follow the laws of newtonian gravitation with every body in the simulation and behave accordingly.
To play, you must have python installed as well as the pygame module. To install pygame, write the following command in your terminal pip install pygame
.
steps to install and play the game
git clone https://github.com/KasraRahimi/planet-system-maker.git
cd planet-system-maker
python run.py
orpython3 run.py
- w - increase planet's speed
- a - increment planet's direction counter-clockwise
- s - decrease planet's speed
- d - increment planet's direction clockwise
- q - increase planet's mass
- e - decrease planet's mass
- r or t - cycle through colors
Here is an example of what the game looks like with some planets orbiting each other.