This p5.js sketch was primarily created by ChatGPT, an AI model from OpenAI, with minimal input from the human assistant. The project showcases the AI's programming abilities by creating an interactive particle simulation in p5.js. Users can interact with particles on the canvas, apply gravity, and see the particles react to a central "planet."
- Generates a configurable number of particles on the canvas.
- Particles follow the user's mouse cursor.
- Users can apply gravity to particles.
- A central "planet" exerts gravitational force on particles.
- Particles change color based on their distance from the mouse cursor.
- Scattering effect when the user clicks on the canvas.
- Ensure you have p5.js installed. If not, download it from here.
- Clone this repository to your local machine.
- Open the
index.html
file in your browser.
- Move your mouse around the canvas to make the particles follow the cursor.
- Click anywhere on the canvas to scatter the particles.
- Press the "G" key to toggle gravity on/off.
- Observe how the particles are attracted to the central "planet."
This project is released under the MIT License.