def set_robot_animation(robot, robot_arms, parent):
    """Set objects and assign anim. behaviour to robot."""
    ### create/reference objects to assist in animation

    d = deque(ys)

    robot_offset = Vector2(
        [a - b for a, b in zip(robot.rect.center, parent.rect.center)]
    )

    parent_rect = parent.rect
    robot_rect = robot.rect

    arm_a, arm_b = robot_arms

    ### define animation behaviour

    def update():

        ## calculate and assign new center for robot
        robot_rect.center = parent_rect.center + robot_offset + (0, d[0])

        ## position robot arms relative to robot's body

        arm_a.rect.midleft = robot_rect.move(0, -55).midleft
        arm_b.rect.midright = robot_rect.move(0, -55).midright

        ## rotate points in deque
        d.rotate(1)

    ### assign the animation behaviour to the robot
    robot.update = update
Set objects and assign anim. behaviour to robot.
nodezator/splashscreen/animsetup.py