COMP 310
Fall 201
6

Lab06: Collisions and Debugging

Home  Info  Canvas   Java Resources  Eclipse Resources  Piazza

Collisions

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!

Debugging

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.


© 2016 by Stephen Wong