Skip to content
jocyk111 edited this page Jan 22, 2015 · 32 revisions
  1. Using arrays, write a program that creates multiple instances of an object (feel free to use an object you developed previously or create something new). Here is an example you can use as a model. You should probably stop here, but here are some additional (more difficult) possibilities.
  • Experiment with the resizable nature of arrays. Can you add objects one at a time? Remove them after a certain amount of time or when they leave the screen? Can objects from an array trigger the birth of other objects? See this example as demonstrated in class.
  • Create an object that stores the history of its own path. This might be a drawing program where you keep a history of mouse locations in an array or a shape that moves around the screen autonomously and draws its own trail. Can you have an array of these objects (each of which stores its own array?). Example 1 Example 2.
  • A String is like an array of characters. Can you create a sketch that plays with text by looping through the "array" inside a String. See: charAt(). We'll get into this in more detail when we look at data, but here is a tutorial you can start with.
  • An image contains an array of pixels. Experiment with image processing by looping through all the pixel colors of the canvas or an image. See this example and this one for some ideas. We'll look at images and pixels more closely tomorrow.
  1. Some reading material / referances:
  2. Put a link below to your sketch as well as documentation of your process.

Add Link Your Homework

Clone this wiki locally