Examples / p5.js Examples / / Planets


example p5.js javascript creating-classes

This sketch shows planets orbiting a sun. Click to add another planet!

Click here to view this code in the p5 editor.


Remix Ideas

  • Make a more realistic simulation of our solar system
  • Create a sketch where a planet orbits a sun, and a moon orbits the planet
  • Instead of the planets only orbiting the sun, make it so their orbits are affected by each other as well

Comments and Questions

Happy Coding is a community of folks just like you learning about coding.
Do you have a comment or question? Post it here!