Adding a fifth value to the rect() can make the corners rounded (See in p5js reference)
(R,G,B,A): A stands for alpha - the transparency of the color.
function setup only goes once, the moment the sketch begins, draw is looping.
The order of the layers: it’s differen’t from photoshop and procreate! In drawing softwares, the layers at the top covers the layers at the bottom (below). But in P5js, since the code runs from the top to the bottom, so it prints the top layers (shapes) first, so these shapes will stay at the bottom. The shapes after will be printed later, so they stat above. Conclusion: In ps/procreate, layers at top in the sidebar = layers at top in the actual drawing. In p5js, layers at top in the code = layers being printed out first = layers at the bottom in the actual drawing.
Global variables: put them at the top
in conditional statement you can only have one “if” and one “else”. but can have a bunch of “else if”.
if x = 275, why this doesn’t work? because as soon as the first value evaluates to be true, we kick out of that and go to the end. So the order of if statements really matters.

How to draw with connected lines then fill them in:
example from the codes Mimi uploaded on week 2:

