Skip to content
mimiyin edited this page May 27, 2020 · 203 revisions

Week 7

RESOURCES FROM CLASS

Questions (example questions)

  • Your questions here

READ / WATCH


Week 6

RESOURCES FROM CLASS

TEST YOURSELF

DO:

  • Next week you will be presenting your own assignments. Time limit is 5 minutes. Be prepared to point out 3 things in your sketch and how they're working. (e.g. Here's a loop, it's limit is being set by the mouse. This doohicky is an object and I have an array of 100 of them. They flicker and change color and when I click, I flip a boolean to make them start and stop flickering.)
  • Design a sketch in an object-oriented fashion. Follow these steps and see how far you get (even just doing the first couple steps is ok!)
    1. Make one single object with just variables.
    2. Put one or more functions in the object.
    3. Try manually making two objects.
    4. Duplicate the object using an array and make as many as you like!
  • If you are already working with classes/objects and arrays:
    1. Re-organize / break-down your classes into the "smallest functional units" possible.
    2. Try different ways to have your objects "communicate" with each other in some way.
  • In the end the goal is to have code in draw() that only makes calls to objects. Something like:
function draw() {
  background(0);
  
  // A single object
  apple.chop();
  // Another object
  orange.peel();
  
  // Calling a function on all of the objects in an array
  for (var i = 0; i < grapes.length; i++) {
    grapes[i].pluck();
  }
}

READ / WATCH

Examples

Questions (example questions)

  • Your question here.

Homework Links


Week 5

Questions (example questions)

  • Your question here

Homework Links


Week 4

Questions (example questions)

  • Your questions here.
  • My checkerboard code works only when rows is less than 10 and I can't figure out why? -Ben

Homework Links

Week 3

Questions (example questions)

  • Your questions here.
  • Can you make p5 sketches shareable and editable between 2 people? Can you define the Input/Output of the assignment? - Pippa

Homework Links


Week 2

  • LINKS FROM CLASS:

  • TEST YOURSELF: Worksheet Post a url to your answers on the Google Doc.

  • DO: Create a sketch that includes (all of these):

    • 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.
    • e.g. Try refactoring your Week 1 HW by removing all the hard-coded numbers except for createCanvas(). Have some of the elements follow the mouse. Have some move independently. Have some move at random.
    • e.g. Do the above but change color, alpha, and/or strokeWeight instead of position.
    • Or do something completely different!
  • WATCH, READ, RUN CODE:

Questions (example questions)

  • Emily -- Can you group multiple shapes together?
  • Sydney -- Is it possible to use noLoop() on a single shape? If not, how does a specific shape inherit a random color without flashing all the different color options?
  • Gil - When applying random to colors, it seems like the same colors repeat themselves. Are there better ways to generate randomality?
  • Shannel - How to apply one function to multiple elements together?
  • Pablo - Is it possible to use different frame rates for different shapes?

Homework Links


Week 1

Questions | Examples

  • your question, your name
  • How to delete a stroke for only one shape, without deleting for the whole image,Benben Fan
  • How to click and place points rather than guessing coordinates - Ben Moll
  • How to add smaller increments to points rather than whole numbers to be exact with coordinates? - Shannel
  • Would splice() function for the array be different from pop() function? - Mingxi
  • Is there a good website to upload photos so that I could fetch them freely without asking for permission and other barriers - Mingxi
  • In the rect() function, the first two parameters determines the left-upper corner position. Can we change the left-upper corner to the center of the rectangle? - Mingxi
  • The code runs even without internet connection; which parts of p5.js are local to the computer and which are online? - Gil
  • It seems to run into performance issues pretty quickly, is that the fate of using a browser-based program? Can it be tweaked? - Gil
  • Is there a way to move or rotate a group of items collectively without displacing their placements in relation to each other? - Tina
  • How do you use mouseX/mouseY on drawings with multiple coordinate points (like a shapes made with quad or bezier curves)? - Tina
  • Is it possible to view the canvas with a grid like you can on the adobe programs? - Sydney
  • Is it possible to tilt an ellipse() function using a base point other than the gravitational center? - Pablo
  • Is there a way to merge two shapes into a single solid that can then be colored in? - Pablo
  • How do you comment out sections/selections of code? - Emily
  • Is there a hotkey/shortcut for the "play" button? - Rachel
  • How do you go about making breakpoints so the design is responsive on mobile? - Rachel
  • How do you make a symmetrical image without doing all the math?

Add Your Homework