How does it work?
- The origin is changed to middle of canvas using
translate for easier drawing.
- There is two objects:
Circle, the most important parameter is
radius is increased according to
rate every time it is updated.
side are important. Rectangle is drew from upper left side of rectangle. So,
yPos are decreased by
side/2(the origin is middle of canvas)
every time it is updated.
Square is created every second.
Square is updated inside
draw function using