Computational Media

ICM - Week 4: Functions

TITLE:  Trippy I

DATE:  October 2016

INSTRUCTORS:  Daniel Shiffman

COLLABORATORS:  N/A

TOOLKITS:  JavaScript + P5.js

 

INSPIRATION 

Stay Trippy Morse gave me the inspiration, and I picked the color from Generate.

 

THE FINAL WORK

Here is the original code.

 

QUESTIONS

  1. Loop like this didn’t work:
  2. why can’t we use arguments like this: color(255,0,0,10)
  3. to create a slider, if I put “mouseX < slider.x * slider.w && mouseX > slider.x – slider.w && mouseY > slider.y – 1 / 2 * slider.h && mouseY < slider.y + slider.h” in the self-defined function instead of mousePressed function, the dragging will be very logy