@Override
    public boolean equals(Object obj) {
        if (!(obj instanceof Ball)) {
            return false;
        }
        Ball other = (Ball) obj;
        return getX() == other.getX() && getY() == other.getY()
                && getWidth() == other.getWidth()
                && getHeight() == other.getHeight()
                && xSpeed == other.getXSpeed() && ySpeed == other.getYSpeed();
    }