December 31, 2021

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

Creating Classes Examples


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

Comments are powered by the Happy Coding forum. This page has a corresponding forum post, and replies to that post show up as comments here. Click the button above to go to the forum to post a comment!