Step 7. Variables in p5.js (mouseX, mouseY)

Daniel Shiffman introduces the fundamental concept of a "variable" in programming. P5 has many variables, including ones that track the mouse position. This leads to our first really cool World, where moving the mouse draws a circle at that position. Click the image to run the World. Click "Clone and Edit" and customise it. Go crazy adding objects. You cannot cause any damage!


Tutorial 2.1
Variables in p5.js (mouseX, mouseY)
Tweet this step: