assignment 1: self portrait

I wanted to create something simple but with some interactivity, so I made a portrait of summer in Abu Dhabi. In the drawing I’m holding up a sign that says “click to make me go inside/outside”, and the user can click anywhere really, and the background toggles between an indoor and outdoor scene. The highlight here is my glasses: they fog up when I’m outside, which is a never ending nuisance, and they clear up again when I’m inside.

The full code is on the p5.js editor and can be seen here, but this is what the final result looks like:

I’m particularly proud of this line:

isInside ? "click to make me go outside" : "click to make me go inside",

I could’ve gone the if/else way, which I always do, but using the conditional operator today made me feel like I had achieved a feat in code optimization.

Certainly, a few small tweaks could make this drawing look much more polished. I wanted to draw some beads of sweat rolling down my face when I’m outdoors. But I would need to think a little more about randomization/motion, so for now I’ll leave this project as is.

One thought on “assignment 1: self portrait”

Leave a Reply