u1[x_] := 
      If[(-1 ≤ x ≤ 1 && 
            x - t ≥ -1 && x + t ≤ 1), t, 
        0]
u2[x_] := 
      If[(x + t ≥ -1 && x - t ≤ -1 && 
            x + t ≤ 1), ((1 + x + t)/2), 
        0]
u3[x_] := 
      If[(x + t ≥ 1 && x - t ≥ -1 && 
            x - t ≤ 1), ((1 - x + t)/2), 
        0]
u4[x_] := 
      If[(x + t ≥ 1 && x - t ≤ -1), 1, 
        0]
g[x_] := u1[x] + u2[x] + u3[x] + u4[x]
Table[
      Plot[g[x], {x, -20, 20}, 
        PlotStyle -> {RGBColor[1, 0.7, 0], Thickness[0.015]}, 
        PlotRange -> {{-20, 20}, {-1.1, 1.1}}], {t, 0, 12, 
        0.1}]