In this activity, you will write JavaScript code using the p5.js library.
p5.js gives you simple tools (like shapes and colors) so you can easily create graphics, animation, and interactive visuals.
https://editor.p5js.org/
Copy this code EXACTLY into your console, do not change the syntax.
Type in the code and produce the same result as on screen.
Experiment, the following goals require you to change numbers and see the result... and change them back if something goes wrong!
Change the background to a grey color.
Change the color of the circle to red.
Change the location of the circle to the top left and make the circle smaller.
Watch the portion of the video called 'mouseX and mouseY' and change your code as demonstrated.
Using the video, create code that makes a 'drawing' tool that leaves behind a trail as you move your mouse.
Experiment, the following goals require you to change numbers or words and see the result... and change them back if something goes wrong!
Change the circle to a square
Make the color of the square change as the mouse moves across the screen
create variables for r, g, and b and have the square change color each time the mouse is pressed