top of page
  • Writer's pictureYang Xu

Week05 ICM



https://editor.p5js.org/nunuyangxu/sketches/abhuTpaOC


 

Worksheet


1. Organize the example Zoog portrait into functions so that you can understand what it’s doing without right comments and you can easily turn different parts of the sketch on/off by commenting in/out calls to your functions.

https://editor.p5js.org/Mollysun99/sketches/hbdZjxu0_


2. Take one of the functions from your re-factored Zoog portrait and re-write it so that you can call the same function twice and have it draw slightly different versions of the same thing. (e.g. Draw a big eye. Draw a little eye.) Alternatively you can try doing this on your own self-portrait.

https://editor.p5js.org/Mollysun99/sketches/OjS3N2ugu


3. Define a portable function that adds two numbers together and returns the sum. You should be able to copy and paste this function definition and only this function definition into a different sketch and use it without creating errors.

https://editor.p5js.org/Mollysun99/sketches/UDPqnC1Yy


4. Re-organize your bouncing ball code from Week 3’s quiz into at least 2 functions.

Challenge: Create a reusable bounce() function that can be

https://editor.p5js.org/Mollysun99/sketches/wa4K6kKhx

10 views0 comments

Recent Posts

See All
bottom of page