import java.awt.*;

/** class Brick extends Sprite
  *
  * class Brick implements a game brick.
  */
class Brick extends Sprite {

  public Brick(Image image, String n) {
    super(image);
    tangible = true;  // The bricks can collide with other sprites
    name = n;
  }

  // If a Brick collides with a ball, it is removed from the playfield.
  public void doCollision(Sprite s) {
    // Did we get hit by a ball?
    if (s instanceof Ball)
      playfield.deleteSprite(this);
    
    // otherwise, we don't care. (What else could have hit us?)
  }

}
