Assignment 1: The More I Smile, The Less I See

I have always been a happy and smiley person. Perhaps more now that I’m doing something I thoroughly enjoy: coding. How do I put this simply? It makes me happy to be happy.  And funnily enough, I get the most compliments when I radiate joy and have a toothy smile on. And my top priority? Make sure my happiness is contagious.


Hence, I chose to make this funny, interactive self-portrait in which I am seen to be miserable but seen to be smiling when my body is clicked on. The idea is that the person is tickling me by clicking on my body, which makes me laugh.

My sketch is fairly simple, but I profusely enjoyed making it! The concept behind had me excited because I can incorporate my personality into my work, which isn’t relatively easy while coding. A particular code I’m proud to share is where I was able to limit the click of the mouse to only a certain place on the sketch. One can’t just click anywhere and make me smile, you have to tickle me at the right spot to make me laugh.

let currentView; //defining a variable, which is going to decide what is going to be displayed

function setup() {
  createCanvas(570, 400); //making a landscape scene
  currentView = noLaugh(); //the initial view is set to my resting face, variable is defined to a value
}

function mousePressed() //when the mouse is clicked
{
  if (mouseX > 212 && mouseX < 350 && mouseY > 285 && mouseY < 400) //setting limits to where you can click to make the view change
  {
    currentView = meLaugh(); //initial view changes because the variable is defined to another value
  }
}

function mouseReleased() //when the mouse is released
{
  currentView = noLaugh(); //view changes to initial setting
}

Above is the work that went into defining variables, setting limits on mouse-clicking-places, and lastly the changes that occur. As much as I tried to be as efficient as possible in my codes, I still missed out on important details. There are places on the body which when clicked, don’t cause a change. That is because I couldn’t accurately put in the coordinates of the body. I hope to improve this aspect of my work and make my sketch more interactive in the future. Moreover, I believe I can work more on the rotation and angling of my shapes, and get more familiar with the calculations with radians and degrees.

 

Leave a Reply