Make things moving!

I begin the project by playing with two little circles that go bigger in time and move from the opposite direction with the mouse and let the background change over time. ↳Here

Then I applied a similar code into my portrait to get my background and nose/mouth color change in time. Eventually, the background turns from a random color to blue, and the nose/mouth turns from a random color to red.

Also by moving the random() function from setup() to draw() allows me to give the skirt random shades of green and refreshes in a loop.

movemoveportrait.gif

I originally used the function map() to move my eyes in a certain range. Then I saw Sammy’s code using sin and frame counts, moving the eyeballs without using the mouse. So I borrowed it and played with that a little bit. (Thanks Sammy!)

A problem I went into when I try to use the function mousePressed(). I try to change the background color to a random color once I press the mouse, but this only happened the first time I pressed the mouse and not changing any color after. (SOLVED, need to remove the background function in draw() )

↳Here is the link to the new little portrait.

Previous
Previous

Turn the light on

Next
Next

As a coding beginner