NOC – Week 2: sketch – Yunyu Zhang(Samantha)

  1. I first made the balls automatically become bigger as they move through adding a new function that keeps enlarging the diameter of the balls.
  2. Then I added another function that makes the balls become smaller when the mouse is clicked also through reducing the diameter.
  3. Then I made another class of triangles that keep going down on the screen through increasing the y position.
  4. In order to make the triangle always on the screen, I made the x position of the triangles go back to 0 when they reach the bottom of the canvas.
  5. I added a new function that makes the triangles move horizontally faster when the mouse is clicked through adding speed to the x position of the triangles.
  6. Then I make the x positions of the moving triangles go back to the center region once they touch the left and right edges of the canvas so that the triangles would not disappear.

Leave a Reply