top of page

ICM Week Two

  • lr2855
  • Sep 25, 2021
  • 1 min read

Task:

  • 1 element controlled by the mouse.

  • 1 element that changes over time, independent of the mouse.

  • 1 element that is different every time you run the sketch.


Task:

  • What are possible arguments for rect()? Come up with 2 sets


Task:

  • 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.


Task:

  • Re-draw the rectangle using line(). Challenge: Write it so that you can easily change the location and size relationship with the canvas.


Task:

  1. Move a circle from the middle of the screen to the right side of the screen.

    1. Add 3 more, 1 moving left, 1 moving up, 1 moving down.

    2. Add 4 more, 1 moving towards each of the 4 corners of the canvas.

    3. 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.


Task:

  • Challenge: Move a circle towards the mouse. Hint: Use mouseX + mouseY.


Task:

  • Challenge: Move your rectangle from Q3 towards the mouse.


Comments


Post: Blog2 Post
  • Facebook
  • Twitter
  • LinkedIn

©2021 by Luhan Rong ITP Life. Proudly created with Wix.com

bottom of page