-
Notifications
You must be signed in to change notification settings - Fork 6
HW Week 6.1
HaleyTat edited this page Oct 18, 2016
·
17 revisions
In class discussion of progress will occur Mon, Oct 10th.
The Final version will be due by Wed, Oct 12th
-
Create a sketch that creates and manages at least 5 objects created from a single class.
- Your class should include both parameters & functions
- The functions should cause the object to do something
- This sketch does not necessarily need to be interactive for the user
- Your class should be written in a seperate
.jsfile that you link to from yourindex.html - You will need to use an array to manage the group of objects
- You are welcome to refactor a previous sketch into this assignment. You may also write a new sketch.
- For additional practice, you should also have at least one additional function defined in your sketch. A simple example would be to create an additional function that renders the background and any other background like elements. This function could take an argument that causes these elements to change as well. Alternatively, this function could be a math function.
-
Here is a suggested work flow for your sketch this week
- Make one single object with just variables.
- Put one or more functions in the object.
- Try manually making two objects.
- Duplicate the object using an array and make as many as you like!
- 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(); } }
-
Additional material that you can review about objects / arrays.
- Videos 6.1-6.5 cover more about objects, arrays, and the constructor function.
- Getting Started with p5.js chapters 10-11 also cover the same material (In the repo).
- Quinn Bruderer [Sketch Pressed Limited] (https://quintinbruderer.github.io/hw 6-1/BallLimitedPressed/) - [Sketch Held Overload] (https://quintinbruderer.github.io/hw 6-1/BallOverloadHeld/) - [Entries] (https://github.com/quintinbruderer/quintinbruderer.github.io/tree/master/hw%206-1)
- Jude MacDonald [Diamonds Shattered and Scattered] (supermafia.github.io/191-p5/Class Objects/) - [ReadMe Reports] (https://github.com/SuperMafia/supermafia.github.io/tree/master/191-p5/Class%20Objects)
- Ian McKay [Blog Entry] (https://github.com/ISmckay/ISmckay.github.io/tree/master/homework_6-1) - [Sketch] (https://ismckay.github.io/homework_6-1/)
- Emily Griffin [README Description] (https://github.com/egriffin2/egriffin2.github.io/tree/master/6.1) - [Sketch] (https://egriffin2.github.io/6.1/)
- Abby Beno [Blog Entry] (https://github.com/abbybeno/abbybeno.github.io/tree/master/HW61) - [Sketch] (https://abbybeno.github.io/HW61/)
- Kayla Robertson [Sketch] (https://kaylarobertson3.github.io/week6/)
- Sierra shaw [Sketch] (https://mistasierra.github.io/HW-6-1/)- [Blog Entry] (https://github.com/MistaSierra/MistaSierra.github.io/tree/master/HW-6-1)
- Stone Deavours- Blog Entry - Sketch
- Haley Tatalovich- Blog Entry - Sketch