Lab 02: Animation

Concepts

  1. Don’t ever call paintComponent or new Graphics(…); because they are provided for you by Java’s graphics framework, which is exists before your code starts running and whose purpose is to make it easier for us to do graphics.
  2. Model-View-Cotroller[2]Design Pattern:
    1. The “Model” knows what your program is, and what its state is.
    2. The “View” knows how to display objects.
    3. The “Controller” knows how to tell a View to display a Model, and how to update the Model based on user input.
    4. The Model and the View never interact with each other; they only talk to the Controller.
    5. Use the MVC design pattern for Homework 2 even though it’s not required, because it will be required for Homework 3.
    6. WindowBuilder’s MVC will start the View instead of the Controller, which is wrong. Change the generated code to start the Controller instead.
  3. Balls (in Homework 2) move discretely, not continuously.
    1. If a ball passes the edge of your screen and bounces back and forth on the edge, it’s because you are making it bounce every time it is across a wall, rather than once per wall.
    2. How do you know where a ball would have been, if it discretely passes the edge? http://www.clear.rice.edu/comp310/f12/assignments/hw02/BallBounce.png
  4. Dr. Wong says “SVN Branch your Homework 1 code to use as the starting point for Homework 2.”
    1. Consider instead:
      1. Duplicate HW01 in Eclipse.
      2. Rename HW01 to HW02 in eclipse.
      3. Commit HW02 to SVN.

Quotes

  1. “Assume a spherical cow (in a vaccum).” – Dr. Wong (and peanut gallery)
  2. “I had an older brother, and to him, I provided the ‘punchingBag’ service. I didn’t know when he would call on that service; he could just walk up whenever he wanted and OOMPH” – Dr. Wong

Resources

  1. Animations: http://www.clear.rice.edu/comp310/JavaResources/animation.html
  2. MVC Design Pattern: http://cnx.org/content/m26104/latest/
  3. Copying a Source-Controlled Project: http://www.clear.rice.edu/comp310/Eclipse/Subclipse/copying/