Week 6 Class Files and Homework

Posted: October 9th, 2010 | Author: | Filed under: Assignments | 15 Comments »


This week we went over drawing functions using pushMatrix and popMatrix(), translate(), rotate() and scale(). We also explored the atan2() function and how it can be used to put objects in a certain direction.

For more information/further reading on this, along with more examples, please see the processing website and read over the following chapters in the book:

The Basics of Drawing with Processing (page 60)

Programming Graphics (page 289)

You should also be experimenting with the basic drawing commands such as line(), rect(), ellipse(), beginShape(), endShape(), etc. These should have been covered in Boot Camp but if you are not familiar with them or feel like you need a refresher let me know.

Code Examples



Our first assignments have been pretty open ended, and have concentrated on a particular aspect of programming. This week I’d like everyone to follow directions and do similar assignments. This will (hopefully) be fun and give everyone an opportunity to combine everything they have learned so far and make a cohesive program.

The assignment is to create a monster, using code only (no images unless they are secondary, hair strands for example would be fine but an entire monster made of 1 image is not).

I made a VERY simple version of what you should be creating, and I commented the code into oblivion so hopefully it should help you along your way.

The creature should

  • Live within a 500×500 processing sketch.
  • White Background
  • All classes as their own files (use tabs!)
  • React to the mouse in some way  (mouse pressed, mouse moved, etc)
  • Be completely contained in an object (the object can include other objects, see example)
  • The object should be named after you (mine is called SteveMonster, you get the idea…)
  • The constructor should take an argument for an x & y position
  • You should translate any drawing to this x&y position first and draw relative to that position
  • Other than that, go wild and try to use everything we’ve learned and some things that we haven’t!

The idea will be that since we are all coding correctly and using similar patterns we should be able to create a gallery of our monsters in class. Please try your best to stick to the requirements!

Please see the attached class files for a simple example that I made (its not really a monster but yours should be 🙂 ). This should follow the requirements completely. Notice that my main sketch does nothing but create my object, give it a position, and tell it to draw. Everything else happens in the object.

Please let me know if you have any questions, and take your time with this assignment. If everyone is able to complete this assignment correctly and creatively I will feel very comfortable letting everyone moving on to bigger projects and running class as more of a workshop and less of a show and tell/lecture format.

Thanks and make something awesome!


PS Check here for some code examples + inspiration


Learn how people did things and don’t copy, just get inspired and change it up!

15 Comments on “Week 6 Class Files and Homework”

  1. 1 Minho Kim said at 8:46 am on October 14th, 2010:


  2. 2 bree said at 1:16 pm on October 14th, 2010:

    Hmmm I did a few things, but forgot to do a monster >.<

    Well, here's a fish (though the applet doesn't work for some reason)

    and some fire \m/


  3. 3 Michelle Kirby said at 2:03 pm on October 14th, 2010:


    soooo many problems. I dono what’s going on but my head can’t process the logic of it all.

  4. 4 Alvaro Soto said at 2:40 pm on October 14th, 2010:


  5. 5 Yiruo Zhao said at 3:12 pm on October 14th, 2010:


  6. 6 Ming-Che,Tu said at 3:13 pm on October 14th, 2010:


  7. 7 Francisco Zamorano said at 3:21 pm on October 14th, 2010:


  8. 8 Seokin Jang said at 3:42 pm on October 14th, 2010:


  9. 9 Oylum said at 4:23 pm on October 14th, 2010:


    This is horrible. Why can’t I code??

  10. 10 Philippe Ramet said at 6:55 pm on October 14th, 2010:


  11. 11 Ming-Che, Tu said at 7:31 pm on October 14th, 2010:


  12. 12 Ben Riley said at 7:34 pm on October 14th, 2010:


    Can’t get him to stay in his proper rotation when mousePressed is false, even though his xPos and yPos change accordingly. Infuriating.

  13. 13 Ming-Che,Tu said at 7:06 pm on October 21st, 2010:


  14. 14 Lisa Lee said at 7:23 pm on October 21st, 2010:


  15. 15 Philippe Ramet said at 7:42 pm on October 21st, 2010:


Leave a Reply