Your Favourite Crayon

Educator notes


Chasing the Mouse


Do this

Write the code in the video (below). 

Replace the ellipse with something cool that follows your mouse! Below is an example but develop your own idea.

Educator notes


The Crayon

Transcript


Do this

Write the example in the video (below). Choose your favourite color and set a new stroke weight.


What is the function of system variables pmouseX and pmouseY?
What command draws a steady line that follows the mouse?

Educator notes


What’s Going on with the Code?

Transcript


Do this

Use the println-command in the draw-method to print the value of a variable to the Console. Below there’s three examples.

println(ballX); println(mouseX); println(mouseY);


What does the command println(ballX); do?
What does the command ellipse(250, 250, mouseX, mouseY); draw?>

Educator notes