This week’s homework is to use variables to create a sketch that includes three kinds code:

  • One element controlled by the mouse.
  • One element that changes over time, independently of the mouse.
  • One element that is different every time you run the sketch

We can create new sketches with simpler shapes or just build off of our week 1 assignment, and I decided to improve my previous work — the self portrait.

The title of my sketch is “Chelsea’s confused by coding”.

For the ” controlled by the mouse” element, I used the mousePressed() function to drive a moving animation, now that my character’s eyes are goggling, eyebrows are raising and frowning, mouse is gaping and closing.

For the element that “changes over time, independently of the mouse”, I give my self portrait a running-text background — just like the hacker style. And I do have some questions want to ask about this part:

How can I make it run smoothly and run without any space between each letter?

Why some texts cover on the top of others now?

I typed (copied+pasted) all those texts line by line, is there any easier way to finish that work?

Why the speed of my flowing text background became super slow after I click my mouse?


For the “different every time” element, it’s pretty easy, I chose to run a random fill() function on the “!TP” text of my t-shirt. So every time you click the run button, the colour of “!TP” will be different.


Here is the link of my work, still, crappy wordpress won’t let me embed it.





  • frameCount  modulus  看余数 6%2=0 7%2=1  8%2=0

frameCount %3 => 0%3=0 1%3=1 2%3=2 …..7%3=1 8%=2….repeat the loop: do xx every 3times.

  • How to do a random function that can output only a few options?

random(a,b)  write a [abcdefg] ask random to pick one

or  On or off random(1)  <0.5 goes to heads; >0.5 goes to tails

group/translate  stacks push() pop()

map() lerp()


or  ||

not !  not cool: !cool


















Posted in ICM

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s