For this week I improved my portrait with some new techniques that I learned from last class.

I tried to add some the face expressions and fake 3d effects of the portrait that changed by moving the mouse from left to right.

I found the connection between each arguments, x and y, and then change them into mouseX and mouseY based on their ratio.

I also added some self-driven animation to the background to make the whole thing more vivid.

屏幕截图 2021-09-20 182639.png

屏幕截图 2021-09-20 182200.png

屏幕截图 2021-09-20 182222.png

屏幕截图 2021-09-20 182247.png

For the worksheet, I got stuck in the Q6 challenge. I divided the conditional statement by four parts of the canvases, which can allow the rectangle gets smaller when it gets close to the edge of the canvases.

屏幕截图 2021-09-20 182110.png

I tried for so long. At the end, I found I got to change the "if(mouseX<width/2, mouseY<height/2)" to "if(mouseX<width/2 & mouseY<height/2)". I have to use &, rather than use ",". Felt happy figuring it out.