From Javascript P5 to Processing 3.x

How to translate the sketch. !!!