The assignment is to partially replicate the
BallWar demo.
You must complete the following features:
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)
Painting should be performed as a strategy that the user can select.
(10 pts)
At least 3 different painting strategies should be available.
(5 pts)
The GUI should be updated to enable different painting strategies to
be selected. (5 pts)
Add methods to the update strategy to (5 pts)
post-collision behavior
kill behavior
Create the following abstract update strategy classes (your actual class
names may differ): (10 pts)
Abstract ANoOpUpdateStrategy that implements no-ops for all
methods.
Abstract AUpdateStrategy which does the following:
update state -- unimplemented
collision -- no-op
kill -- calls context ball's killSelf method.
All strategies that do not implement both collision and kill should
be descendents of one of these abstract classes.
Add methods to the Ball
Add "kill" method invoke kill behavior on strategy. (5
pts)
Add "killSelf" method actually perform the deletion process of that
ball from the dispatcher. (5 pts)
Balls should be given a reference to an "environment" upon
instantiation. (10 pts)
This should replace the reference to the drawing canvas.
Do not give the balls a direct reference
to the model! Give the balls a interface which only has a few
necessary methods on it,e.g.
accessor for the dispatcher
Width and height of the drawing canvas.
etc
Collision handling should be implemented:
Collision handling should be performed by a "source" ball sending a
command out the dispatcher to the other "target" balls. (10 pts)
Balls should bounce off of one another at their edges.
(5 pts)
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.