# CODE I GOT FROM A BLACK MAN

transform xcenter:
    xanchor 0.5 yanchor 0.0

transform setx(x=0.5):
    xpos x
transform sety(y=0.0):
    ypos y
transform setxy(x=0.0, y=0.0):
    xpos x ypos y

define eidissolve = Dissolve(0.5, time_warp=_ease_in_time_warp) # Ease-in Dissolve
define eodissolve = Dissolve(0.5, time_warp=_ease_out_time_warp) # Ease-out Dissolve

transform moveindown(x=0.5, y=0.0, m=0.2, t=0.75):
    subpixel True
    xpos x
    ypos y - m
    easein_cubic t ypos y

transform moveinup(x=0.5, y=0.0, m=0.2, t=0.75):
    subpixel True
    xpos x
    ypos y + m
    easein_cubic t ypos y

transform moveinleft(x=0.5, y=0.0, m=0.2, t=1):
    subpixel True
    ypos y
    xpos x + m
    easein_cubic t xpos x

transform moveinright(x=0.5, y=0.0, m=0.2, t=1):
    subpixel True
    ypos y
    xpos x - m
    easein_cubic t xpos x

transform moveindown_a(x=0.5, y=0.0, m=0.2, t=0.75, d=0.0):
    subpixel True
    xpos x
    ypos y - m
    alpha 0
    pause d
    parallel:
        easein_cubic t ypos y
    parallel:
        easein_cubic min(0.5, t) alpha 1

transform moveinup_a(x=0.5, y=0.0, m=0.2, t=0.75, d=0.0):
    subpixel True
    xpos x
    ypos y + m
    pause d
    parallel:
        easein_cubic t ypos y
    parallel:
        easein_cubic min(0.5, t) alpha 1

transform moveinleft_a(x=0.5, y=0.0, m=0.2, t=1, d=0.0):
    subpixel True
    ypos y
    xpos x + m
    alpha 0
    pause d
    parallel:
        easein_cubic t xpos x
    parallel:
        easein_cubic min(0.5, t) alpha 1

transform moveinright_a(x=0.5, y=0.0, m=0.2, t=1, d=0.0):
    subpixel True
    ypos y
    xpos x - m
    alpha 0
    pause d
    parallel:
        easein_cubic t xpos x
    parallel:
        easein_cubic min(0.5, t) alpha 1

transform moveoutdown(y=0.0, m=0.1, t=0.5):
    subpixel True
    on hide:
        parallel:
            easeout_cubic t ypos y + m
        parallel:
            time t - 0.5
            easeout_cubic min(0.5, t) alpha 0

transform moveoutup(y=0.0, m=0.1, t=0.5):
    subpixel True
    on hide:
        parallel:
            easeout_cubic t ypos y - m
        parallel:
            time t - 0.5
            easeout_cubic min(0.5, t) alpha 0

transform moveoutleft(x=0.5, m=0.15, t=0.75):
    subpixel True
    on hide:
        parallel:
            easeout_cubic t xpos x - m
        parallel:
            time t - 0.5
            easeout_cubic min(0.5, t) alpha 0

transform moveoutright(x=0.5, m=0.15, t=0.75):
    subpixel True
    on hide:
        parallel:
            easeout_cubic t xpos x + m
        parallel:
            time t - 0.5
            easeout_quad min(0.5, t) alpha 0

transform movex(x=0.5, t=1):
    subpixel True
    easein_cubic t xpos x

transform movey(y=0.0, t=1):
    subpixel True
    easein_cubic t ypos y

transform movexy(x=0.5, y=0.0, t=1):
    subpixel True
    easein_cubic t xpos x ypos y

transform easemovex(x=0.5, t=1):
    subpixel True
    ease_cubic t xpos x

transform easemovey(y=0.5, t=1):
    subpixel True
    ease_cubic t ypos y

transform easemovexy(x=0.5, y=0.0, t=1):
    subpixel True
    ease_cubic t xpos x ypos y

transform vibratex(x=0.5, i=1.0, s=1.0):
    subpixel True
    linear (0.03*s) xpos x - (0.0007 * i)
    linear (0.03*s) xpos x + (0.0007 * i)
    repeat

transform vibratey(y=0.0, i=1.0, s=1.0):
    subpixel True
    linear (0.03*s) ypos y - (0.0015 * i)
    linear (0.03*s) ypos y + (0.0015 * i)
    repeat

transform jumping:
    easein 0.2 yoffset -10
    easeout 0.2 yoffset 0

transform walking:
    parallel:
        easein 0.4 yoffset 10
        easeout 0.4 yoffset 0
        pause 1.0
        repeat
    parallel:
        easein 0.6 xoffset -15
        easeout 0.6 xoffset 0
        easein 0.6 xoffset 15
        easeout 0.6 xoffset 0
        pause 1.0
        repeat

transform vibratex(x=0.5, i=1.0, s=1.0):
    subpixel True
    linear (0.03*s) xpos x - (0.0007 * i)
    linear (0.03*s) xpos x + (0.0007 * i)
    repeat

transform vibratey(y=0.0, i=1.0, s=1.0):
    subpixel True
    linear (0.03*s) ypos y - (0.0015 * i)
    linear (0.03*s) ypos y + (0.0015 * i)
    repeat