def get_contact_indices(layer_0, layer_1):
    """Get counter that finds index pairs of all contacts between layers.
    
    Args:
        layer_0: String. Must be key in state.
        layer_1: String. Must be key in state.

    Returns:
        _call: Function state --> list, where the elements of the returned list
            are tuples (i_0, i_0) of indices of sprites in layer_0 and layer_1
            that are contacting.
    """

    def _call(state):
        """Gets all (i_0, i_1) such that layer_0[i_0] contacts layer_1[i_1]."""
        contact_indices = []
        for i_0, sprite_0 in enumerate(state[layer_0]):
            for i_1, sprite_1 in enumerate(state[layer_1]):
                if sprite_0.overlaps_sprite(sprite_1):
                    contact_indices.append((i_0, i_1))
        return contact_indices
    return _call