COMP 310
Spring 2019

Lab06: Collisions and Debugging

Home  Info  Canvas   Java Resources  Eclipse Resources  Piazza


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.


Visitor Exercises

Work on the visitor exercises detailed in lecture to gain experience with visitors.

© 2019 by Stephen Wong