Moving with the mouse
Arc Refresher
Having watched 2.1 variables in p5.js (mouseX, mouseY)
mousePressed()
{
rect(mouseX,mouseY,10,10);
}
{
rect(10,10,mouseX,mouseY);
}
Try them!
Variables Introduction
Having watched 2.1 variables in p5.js (mouseX, mouseY)
- In p5js, what is an EVENT?
- What does the variable mouseX do?
- Pair/Share: What does this do?
mousePressed()
{
rect(mouseX,mouseY,10,10);
}
- Pair/Share: What does this do?
{
rect(10,10,mouseX,mouseY);
}
Try them!
Variables Introduction
- Look at mousePressed() in reference section of p5js
- Drawing Challenge