This project is a simple particle simulation implemented in Python using Pygame. It simulates the motion of particles under the influence of gravitational forces.
The simulation consists of particles moving within a defined space, interacting with each other based on gravitational attraction. The particles are represented as small circles on the screen, and their motion is calculated using Newtonian mechanics.
To run the simulation, make sure you have Python,Numba and Pygame installed on your system. You can install Pygame using the following command:
pip install pygame
pip install numba
-
Clone this repository to your local machine.
-
Navigate to the project directory.
-
Run the main script using Python:
-
Once the simulation window opens, you can interact with it by:
- Adding particles: Press and hold the left CTRL key and click on the screen to add particles at the cursor position.
- Generating particle configurations:
- Press '1' to generate a line of particles at the current Y-coordinate of the cursor.
- Press '2' to generate a circular cluster of particles around the cursor position.
- Press '3' to generate a line of particles at the current X-coordinate of the cursor.
-
Observe the particles' motion and interactions as they move around the screen.