Processing+Problem+Set+2

Processing Problem Set 2 Functions, Objects and Arrays

Problems: 1. Painting with pixels. For this problem, you will create virtual // paint brush //. Create a function that draws a pattern at a given (x, y) position. Use your function in conjunction with Processing's mouse events to make a drawing tool. Experiment with shape, colour, transparency, etc..! [3 pts] 2. Modify your paint brush so that it varies over time, too. The variation should be introduced as one or more new parameters to the brush function. // Hint: remember that the draw function behaves as a loop! // [2 pts]

3. Little people. Create a // little // character and defne it using a class. Your character can be anything really (it doesn't have to be an animal -- inanimate objects works too). Give it a simple behaviour (for instance, your thing could bounce around the screen, but it could be anything else as well) [3 pts] 4. Write an applet that uses the class you defined in Question 4 to draw and animate at least // 50 things. // [2 pts] 5. Using the techniques we've learned so far, modify your class so that individual objects react to the mouse according to // how far away they are from it //. Feel free to add other interactions as well, like clicks. [4 pts]