def detect_collisions(good_snake, bad_snake):
    """
    Detect collisions between the Good Snake and the Bad Snake, and
    between the Good Snake and itself.

    Returns True if there's been a collision and False otherwise.
    """
    for python_area in good_snake.get_rects():
        for bad_snake_area in bad_snake.get_rects():
            if python_area.colliderect(bad_snake_area):
                return True

    # detect collisions with ourself
    if good_snake.head_hit_body():
        return True

    return False