P5 Continued - More things

Demo today explores some key concepts for moving p5 beyond it's basic "setup" and "draw loops"

First, each of these canvases below is created in the same sketch.js file, and attached to the divs in which they appear using the syntax var my p5 = new p5('some sketch', 'container id'). This is called Instance mode in P5. Dan Shiffman has a great video on instance mode and namespacing in JavaScript.

Open the sketch.js file that this file calls to see how this works.

We'll also be looking at simple mouse interactions, and controlling how animation happens over time with setInterval().