Intro to Comp Media
WEEK 2
Updated Self Portrait
Worksheet:
Make up your own arguments for rect()? Come up with at least 2 sets.
Draw a rectangle in the middle of the screen that is half the width and half the height of the canvas. Write it so that you can change the size of the canvas and the rectangle will stay in the center and maintain its size relationship to the canvas. Re-draw the rectangle using line(). Challenge: Write it so that you can easily change the location and size relationship with the canvas.Move a circle from the middle of the screen to the right side of the screen.
Add 3 more, 1 moving left, 1 moving up, 1 moving down.Add 4 more, each moving towards each of the 4 corners of the canvas.Make one of your circles move 10 times faster than the other circles.Challenge: Re-write 4b. so if I change the width of the canvas, the circles still go to the corners without having to change any other code.Challenge: Move a circle towards the mouse. Hint: Use mouseX + mouseY.Challenge: Move your rectangle from Q3 towards the mouse.