Clear[s, im1, im2, im3, im4, im5, im6, im7, im8, im9, im10, 
      f]
s[x_] := 
      If[1 ≤ x < 2, x - 1, 
        If[2 ≤ x ≤ 3, 3 - x, 
          0]]
im1[x_] := 
      If[-3 ≤ x < -2, x + 3, 
        If[-2 ≤ x ≤ -1, -1 - x, 
          0]]
im2[x_] := 
      If[9 ≤ x < 10, 9 - x, 
        If[10 ≤ x ≤ 11, x - 11, 
          0]]
im3[x_] := 
      If[-11 ≤ x < -10, -11 - x, 
        If[-10 ≤ x ≤ -9, x + 9, 
          0]]
im4[x_] := 
      If[13 ≤ x < 14, 13 - x, 
        If[14 ≤ x ≤ 15, x - 15, 
          0]]
im5[x_] := 
      If[-15 ≤ x < -14, -15 - x, 
        If[-14 ≤ x ≤ -13, x + 13, 
          0]]
im6[x_] := 
      If[21 ≤ x < 22, x - 21, 
        If[22 ≤ x ≤ 23, 23 - x, 
          0]]
im7[x_] := 
      If[-23 ≤ x < -22, x + 23, 
        If[-22 ≤ x ≤ -21, -21 - x, 
          0]]
im8[x_] := 
      If[25 ≤ x < 26, x - 25, 
        If[26 ≤ x ≤ 27, 27 - x, 
          0]]
im9[x_] := 
      If[-27 ≤ x < -26, x + 27, 
        If[-26 ≤ x ≤ -25, -25 - x, 
          0]]
im10[x_] := 
      If[33 ≤ x < 34, 33 - x, 
        If[34 ≤ x ≤ 35, x - 35, 
          0]]
f[x_] := (1/2) (s[x + t] + s[x - t] + im1[x + t] + im1[x - t] + 
            im2[x + t] + im2[x - t] + im3[x + t] + im3[x - t] + im4[x + t] + 
            im4[x - t] + im5[x + t] + im5[x - t] + im6[x + t] + im6[x - t] + 
            im7[x + t] + im7[x - t] + im8[x + t] + im8[x - t] + im9[x + t] + 
            im9[x - t] + im10[x + t] + 
            im10[x - t])
xd = 
      Table[Plot[f[x], {x, -30, 40}, 
          PlotRange -> {{-30, 40}, {-1.5, 1.5}}, 
          AxesLabel -> {"x", "free"}, 
          PlotStyle -> {RGBColor[0, 1, 0], Thickness[0.01]}], {t, 0, 20, 
          0.2}]
Export["\:6709\:9650\:9577\:7e69\:7684\:6620\:50cf\:6cd5-\:53f3\:56fa\
\:5de6\:81ea.avi", xd]