-
Notifications
You must be signed in to change notification settings - Fork 6
Assignment 4
jocyk111 edited this page Jan 22, 2015
·
32 revisions
- 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.
- Some reading material / referances:
- Chapters 6 and 9 from Learning Processing cover the same concepts in the Java programming language.
- Array tutorial from Mozilla
- Array tutorial from JQuery
- For a JavaScript tutorial about arrays I would suggest Chapter 4 of Eloquent JavaScript though I would warn that it gets a bit more advanced than what we need for p5.js sketches.
- Put a link below to your sketch as well as documentation of your process.
- Daniel Shiffman: p5.js work, blog link, blog link, etc.
- Duru: [Blurred Disco] (http://dda255.imnyuad.com/assignment4/), [Blog post 4] (http://dda255.imnyuad.com/blog/?p=30)
- Thinh: It's raining, Write-up
- Jocelyn: [Ghosting] (http://jks405.imnyuad.com/assignment4), [Post] (http://jks405.imnyuad.com/blog/?p=60)
- Amber: Chaos, write-up
- Eszter:Still rainy London, [write-up] (http://es3099.imnyuad.com/blog/?p=50)
- Benny: [Aquarium Bubbles] (http://pyl266.imnyuad.com/Assignment%2004%20Alt/), [Nervous Bubbles] (http://pyl266.imnyuad.com/Assignment%2004/), [Bubbles and Arrays write-up] (http://pyl266.imnyuad.com/blog/?p=30)
- Andrei:[Apple tree - doesn't work quite as desired] (http://as8490.imnyuad.com/Assignment4/), [write-up] (http://as8490.imnyuad.com/blog/?p=13)
- Talha: [Mouse-Trail] (http://tj626.imnyuad.com/assignment4/), [Write-up] (http://tj626.imnyuad.com/blog/?p=64)
- Yanfei: Swirl, Swirl(no trail, more particles), Blog.
- Antenah:sky full of stars. [Documentation] (http://atz214.imnyuad.com/blog/)
- Abhijai: [Bubble Burst] (http://ag3754.imnyuad.com/assignment4/). [Documentation (in progress)] (http://ag3754.imnyuad.com/blog/?p=28).
- Nkos'khona: [Controlled Ellipses] (http://nmm380.imnyuad.com/Assignment4/). [Documentation] (http://nmm380.imnyuad.com/blog/?p=16)
- Jean: [Speed game] (http://jne241.imnyuad.com/Assignment%204/), [Write up] (http://jne241.imnyuad.com/blog/?p=52)