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.

I set a square with its position, velocity, width, and color.
The movement of the square is set using its position and velocity. It bounces when the square touches the edges of canvas.
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