MLNI Week2- p5 drawing functions (Crystal Liu)

Inspired by my phone case, I used p5 to draw a cactus. I mainly used functions about drawing shapes such as rect(), triangle(), ellipse() and quad(). It helped me recall the knowledge about how to draw a polygon and how many elements that each shape needs. I also found some problems about coding. One of them is that I’m not familiar with the function about mouse and keyboard. At first I want to achieve this effect – a triangle appears on the screen with a click of the mouse. I’ve tried mouseClicked but it doesn’t work. After several tries I had to search online about the tutorial but still didn’t work. Thus I had to give up for a moment and tried other functions first. If after next class I still don’t know how to achieve this effect, I will ask professor for help. Finally it looks like this:

My code

Leave a Reply