Hello @Pleasegod,
Welcome to the forum.
This is an excellent resource to help with gravity:
https://natureofcode.com/book/
Please read our Processing Forum Guidelines:
Processing Forum Guidelines < Click here to open!
I am sharing these Processing forum guidelines as a courtesy to start you on your journey.
Please read:
- Processing FAQ - Frequently asked questions
- Guidelines - Asking Questions
- Guidelines - Answering Questions
- p5.js Community Statement
Our homework policy:
FAQ - Processing Foundation
If this is a homework question please tag it as homework.
Please format and post code as per these instructions:
FAQ - Processing Foundation < It is Ctrl+T in Processing for Windows
Processing resources are here:
https://processing.org/
:)