top of page

ICM: Oct.18th

  • lr2855
  • Oct 18, 2021
  • 1 min read

In this particular example, I organized two functions to set up the bouncing ball.


see the demo video below:

Questions: I am unclear about how to use p5.vector in different use cases.

  1. I set a square with its position, velocity, width, and color.

  2. The movement of the square is set using its position and velocity. It bounces when the square touches the edges of canvas.

  3. fill the square, and draw a rectangle using the x, y position and width.

4. set block equal to the new square.

5. create a vector using any position in the canvas.

6. new 2 random angle vector multiple 5. (velocity)



Comentarios


Post: Blog2 Post
  • Facebook
  • Twitter
  • LinkedIn

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

bottom of page