Week 4, Object Oriented Programming

Posted: September 24th, 2010 | Author: | Filed under: Assignments, Examples | 11 Comments »

This week we went over a lot, so try to look at the examples and play around with them before moving onto your assignment. I also recommend looking at Chapter 5 of the Programming interactivity book for a general overview of everything we went over in class. The section on OOP starts on page 129.

oopExamples

Homework Assignment

This weeks homework assignment will be similar to last week, but with a concentration on using objects. The requirements are:

-A minimum of 25 objects, which are stored in an array

-Different behaviors for the objects based on input (mouse position, mouse press/release, key presses, etc)

-All drawing of your object (ellipse(), rect(), etc, any call that directly draws to the screen) should be within your object

-All objects should not look the same, they can be similar but think about how you can use properties (variables) within the class to make them unique. Experiment with RGB, alpha, size, position, etc.

Bonus

-Use fonts or images instead of drawing shapes

-Create an object that contains a number of other objects, ie: a CircleGroup class that contains man Circle objects…

Try to think about what you want to do BEFORE you start to program and think about how it would make sense logically. It may be best to work with your classmates/ask questions of each other. As usual I am always available for help through email, but please have a specific question and code that shows you have tried to make things work.

Thanks and see you in class Thursday!


11 Comments on “Week 4, Object Oriented Programming”

  1. 1 Oylum Boran said at 2:15 am on September 30th, 2010:

    Hey,

    I have 3 incomplete projects. I was confused and got stuck.

    First one: I am trying to make a little game in which there are randomly moving circles that I need to click on to make them disappear. When I’m finished, it should say game over and start over.

    However, I can’t figure out how to make the object understand that it is selected and disappear only that object. Right now, I cant make it, everything is disappearing.

    http://a.parsons.edu/~borao194/blog/files/cclab/03/oop01/

    Second one: It is similar to the first one, my problem is the same. I need to learn how to select a particular object.

    http://a.parsons.edu/~borao194/blog/files/cclab/03/oop02/

    Third one: We made a game in Bootcamp Workshop in which you have a spacecraft and shoot the circles to make them disappear. The code was written with functions only and i tried to re-write it with objects. However, it got stuck so bad because functions are related to each other with if/else s and I can’t just adopt them to oop. I hope we can figure it out in the class.

    http://a.parsons.edu/~borao194/blog/files/cclab/03/oop03_asteroids

  2. 2 Minho Kim said at 7:51 am on September 30th, 2010:

    http://a.parsons.edu/~kimm541/03/

  3. 3 bree said at 2:17 pm on September 30th, 2010:

    I can’t get it working exactly how I would like, but…

    http://a.parsons.edu/~rubib864/CCLab/ballsandsquares/index.html

  4. 4 Francisco Zamorano said at 2:48 pm on September 30th, 2010:

    Good exercise, I’m understanding how objects work.
    One detail: These circles stay between posY=0 and posY=200, but they should be randomly assigned along the height. (If you take the background it seems that it works, but for some reason they stick in the upper part of the screen).

    http://a.parsons.edu/~zamof709/CCLAB/HW_Week4_Francisco/applet/index.html

  5. 5 Lisa Lee said at 6:49 pm on September 30th, 2010:

    http://a.parsons.edu/~leei674/MFADT2010_Fall/cc_lab/0930/applet/index.html

    Move the mouse to put all balls back to the left and also change the colors of background stripes.

    Press a button to see another picture.

  6. 6 Yiruo Zhao said at 6:55 pm on September 30th, 2010:

    http://a.parsons.edu/~zhaoy563/CClab/week04/

  7. 7 Philippe Ramet said at 7:10 pm on September 30th, 2010:

    homework, squares moving, interactions with mouse and keyboard

  8. 8 Thomas Tu said at 7:19 pm on September 30th, 2010:

    press u to let the matrix stream go up;
    press any key to stop the stream;
    press “b” to call batman;
    press mouse to eject spider filmant.

  9. 9 Michelle Kirby said at 7:21 pm on September 30th, 2010:

    http://a.parsons.edu/~kirbm818/ccLab/Hw%20wk5/applet/

  10. 10 Alvaro said at 7:21 pm on September 30th, 2010:

    http://a.parsons.edu/~sotoa363/cclab/appletstar/

  11. 11 Seokin Jang said at 7:21 pm on September 30th, 2010:

    Ass#3
    http://a.parsons.edu/~jangs384/Seokin3/applet/

    Ass#1
    http://a.parsons.edu/~jangs384/Seokin2/


Leave a Reply