COMP 310
Fall 2012

Lab06: Collisions and Debugging

Home  Info  Owlspace  Java Resources  Eclipse Resources


Recap of collisions from lecture.

Adding collisions to Ballworld:

  1. Create a new CollideStrategy that implements IUpdateStrategy.

  2. Copy the provide code for the CollideStrategy from here.

  3. In updateCollision, comment out the following line (you may want this back for other interactions, i.e., eat, kill, etc.):

    context.interactWith(target, dispatcher);

  4. Implement the updateState method of your CollideStrategy.

    1. The recipe for the command is given right above the provided code.

    2. Be sure to make use of the other provided methods - you do not need to reimplement the physics of collisions, we have provided it for you!


Recap of debugging from lecture.   We will try our hand at the various debugger features in lab.

© 2012 by Stephen Wong