COMP 310
Spring 2010

HW03: BallWar upgrade, part 1

Home  Info  Owlspace  Resources

Assignment Instructions and Point Values

The assignment is to partially replicate the BallWar demo.   You must complete the following features:

  1. The architecture must be a Model-View-Controller design with apprpriately created interfaces and adapters and appropriate methods on each interface/adapter.  Unrelated methods should not be placed on the same adapter/interface  (25 pts)
  2. Painting should be performed as a strategy that the user can select.  (10 pts)
  3. Add methods to the update strategy to (5 pts)
    1. post-collision behavior
    2. kill behavior
  4. Create the following abstract update strategy classes (your actual class names may differ): (10 pts)
    1. Abstract  ANoOpUpdateStrategy that implements no-ops for all methods.
    2. Abstract AUpdateStrategy which does the following:
      • update state -- unimplemented
      • collision -- no-op
      • kill -- calls context ball's killSelf method.
    3. All strategies that do not implement both collision and kill should be descendents of one of these abstract classes.
  5. Add methods to the Ball
    1. Add "kill" method invoke kill behavior on strategy.   (5 pts)
    2. Add "killSelf" method actually perform the deletion process of that ball from the dispatcher. (5 pts)
  6. Balls should be given a reference to an "environment" upon instantiation.  (10 pts)
  7. Collision handling should be implemented:
    1. Collision handling should be performed by a "source" ball sending a command out the dispatcher to the other "target" balls.  (10 pts)
    2. Balls should bounce off of one another at their edges.    (5 pts)
    3. Post-collision behavior capability should be implemented, for some strategies, e.g.  (5 pts)
      • Print a "I'm hit" -type message to the console
      • Create a "Kill" strategy that will delete the target ball from the dispatcher.

 


© 2010 by Stephen Wong