Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
p5js-week-10 [2022/07/02 11:57] renickp5js-week-10 [2023/06/29 22:50] (current) reina.chen
Line 1: Line 1:
 ====== p5js week 10 ====== ====== p5js week 10 ======
 +
 +{{:buttered-toast-1308351657802.jpg?600|}}
 +
 +It usually takes butter to make good toast. In our case, practice will be the butter for our toast.
 +
 +Before we practice, though, we want to spend a little time working on our wiki pages. Work with the teacher to make some improvements to your wiki page. After that, come back to this practice!
  
 Using classes seems hard, so let's do another simple one step by step. Here's what we want to do: Using classes seems hard, so let's do another simple one step by step. Here's what we want to do:
Line 23: Line 29:
 Now we'll make a class and put this in the draw method so that we can draw it. Now we'll make a class and put this in the draw method so that we can draw it.
  
-Notice that we have to call the constructor once using the "new" keyword with the class name to make an object to draw.+Notice that we have to call the constructor once using the <color black/yellow>"new"</color> keyword with the class name to make an object to draw.
  
 <HTML> <HTML>
Line 57: Line 63:
 ===== now it's your turn... ===== ===== now it's your turn... =====
  
-Go ahead. Start with the easiest version of this ButteredToast class, then replace the draw method with your own code. Don't forget to rename the class to something appropriate.+Go ahead. Start with the easiest version of this ButteredToast class, then replace the draw method with your own code. Don't forget to rename the class to something appropriate. You'll need to change the name in the place where you call the constructor, too (hint: look for the new keyword). 
 + 
 +Remember, these are the instructions from last time. Can you make a drawing that does the following? 
 + 
 +  - draw an animal, plant, or a complicated shape from your imagination 
 +  - there should be many different versions of it, like different sizes and different colors 
 +  - make a class to draw it 
 +  - use buildArray to fill an array of objects from your class; try to make 100 or more! 
 +  - use filter to change your drawing in some way 
 + 
 +When you're done, be sure to put it on the wiki!
  
  • p5js-week-10.1656788233.txt.gz
  • Last modified: 3 years ago
  • by renick