Exemplo n.º 1
0
    def action():
        nonlocal pos

        def processor(rad):
            return (1 - sin(rad)) * (big_rad / 2)

        x, y = from_polar(pos, processor)
        move_to(small_ball, x, y, True)
        pos += _step
Exemplo n.º 2
0
    def action():
        global pos

        def processor(rad):
            return rad * 5 + sin(rad * wave_freq) * wave_amp / 5 * (-rad / 5)

        x, y = from_polar(pos, processor)
        move_to(small_ball, x, y, True)
        pos += _step
Exemplo n.º 3
0
    def action():
        global pos

        def processor(rad):
            return sin(6 * rad) * big_rad

        x, y = from_polar(pos, processor)
        move_to(small_ball, x, y, True)
        pos += _step
Exemplo n.º 4
0
    def action():
        to_center(small_ball)

        global pos

        def processor(rad):
            return 4 * sin(2 * rad) * big_rad / 4

        x, y = from_polar(pos, processor)
        move_to(small_ball, x, y, True)
        pos += _step
Exemplo n.º 5
0
    def action():
        nonlocal pos

        def processor(rad):
            return (2 - 2 * sin(rad) + sin(rad) *
                    ((abs(cos(rad)))**(1 / 2) /
                     (sin(rad) + 1.4))) * big_rad / 2

        x, y = from_polar(pos, processor)
        move_to(small_ball, x, y + big_rad * (4 / 5), True)
        pos += _step
Exemplo n.º 6
0
    def action():
        global pos, _step

        if 0 <= ((pos - (90 / 3)) % (90 * 2 / 3)) <= (90 * 2 / 3):

            def processor(rad):
                return big_rad * cos(3 * rad)
        else:

            def processor(rad):
                return 0

            pos -= (90 * 2 / 3)
            _step = -_step

        x, y = from_polar(pos, processor)
        move_to(small_ball, x, y, True)
        pos += _step
Exemplo n.º 7
0
    def action():
        global pos, _step

        if 45 <= ((pos - 90) % 180) <= 135:

            def processor(rad):
                return 4 * cos(2 * rad) * big_rad / 4
        else:

            def processor(rad):
                return 0

            pos -= 180
            _step = -_step

        x, y = from_polar(pos, processor)
        move_to(small_ball, x, y, True)
        pos += _step
Exemplo n.º 8
0
def task_10():
    """Heart"""
    pos = 90
    move_to(small_ball, 0, big_rad * (4 / 5))

    def action():
        nonlocal pos

        def processor(rad):
            return (2 - 2 * sin(rad) + sin(rad) *
                    ((abs(cos(rad)))**(1 / 2) /
                     (sin(rad) + 1.4))) * big_rad / 2

        x, y = from_polar(pos, processor)
        move_to(small_ball, x, y + big_rad * (4 / 5), True)
        pos += _step

    loop(action)