g=9.8*10^-1; (*重力加速度*)
cor = 0.6; (*ボールの反発係数*)
fs = 1.4;(*ボールの初速*)
ballx = 4-fs*t ;
ballz = If[t < 3.8190286472402155,
fs*t-(g/2)*t^2 ,
fs*cor*(t-3.8190286472402155)-(g/2)*(t-3.8190286472402155)^2 
];
(*山部分のディレイタイム設定*)
dmt[dt_] = {{dt-t,-1.6},{dt+3-t,3},{dt+5-t,2},{dt+7-t,4},{dt+14-t,-1.6}};
x0=5Cos[0.2t];
y0=4Sin[0.2t]-1;
 x1=0.2Cos[-t] - 0.2;
y1=0.2 Sin[-t] - 0.4;
 x2=0.2Cos[-t +Pi] - 0.2;
y2=0.2 Sin[-t + Pi] - 0.4;
(*ペダルをこぐ円*)
lx[t_]=0.3 Cos[-t] - 0.3;
ly[t_]=0.3 Sin[-t] - 1.1;
(*スポーク f -> 前輪　r -> 後輪*)
fwheel[t_]={ Cos[-t] + 1.2,Sin[-t] - 0.6};
rwheel[t_]={0.6 Cos[-t] - 1,0.6 Sin[-t] - 1};



(*今回はオブジェクト指向的なやり方で。まずは自転車を作る*)
bike={
(*前輪*)
{Thick,Circle[{1.2,-0.6},1.0]},
(*後輪*)
{Thick,Circle[{-1,-1},0.6]},

(*フレーム*)
{Thick,Line[{{-1,-1},{-0.3,-1.1},
{0.6,0.8},{-0.5,-0.3},{-1,-1}}]},
{Thick,Line[{{-0.3,-1.1},{-0.6,-0.1}}]},
{Thick,Line[{{-0.8,-0.1},{-0.5,-0.1}}]},
{Thick,Line[{{1.2,-0.6},{0.5,1},
{0.2,1},{0,0.6},{-0.1,0.65}}]},

(*ペダル*)
{Thick,Circle[{-0.3,-1.1},0.2]},
{Thick,Line[{{-0.3,-1.1},{lx[t],ly[t]}}]},
{Thick,Line[{{lx[t] - 0.05,ly[t]},{lx[t] + 0.05,ly[t]}}]},
{Thick,Line[{{-0.3,-1.1},{lx[t+Pi],ly[t+Pi]}}]},
{Thick,Line[{{lx[t+Pi] - 0.05,ly[t+Pi]},{lx[t+Pi] + 0.05,ly[t+Pi]}}]},

(*前輪*)
Line[{{1.2,-0.6},fwheel[6t]}],
Line[{{1.2,-0.6},fwheel[6t + 0.25 Pi]}],
Line[{{1.2,-0.6},fwheel[6t + 0.5 Pi]}],
Line[{{1.2,-0.6},fwheel[6t + 0.75 Pi]}],
Line[{{1.2,-0.6},fwheel[6t + Pi]}],
Line[{{1.2,-0.6},fwheel[6t + 1.25 Pi]}],
Line[{{1.2,-0.6},fwheel[6t + 1.5 Pi]}],
Line[{{1.2,-0.6},fwheel[6t + 1.75 Pi]}],

(*後輪*)
Line[{{-1,-1},rwheel[6t]}],
Line[{{-1,-1},rwheel[6t + 0.25 Pi]}],
Line[{{-1,-1},rwheel[6t + 0.5 Pi]}],
Line[{{-1,-1},rwheel[6t + 0.75 Pi]}],
Line[{{-1,-1},rwheel[6t + Pi]}],
Line[{{-1,-1},rwheel[6t + 1.25 Pi]}],
Line[{{-1,-1},rwheel[6t + 1.5 Pi]}],
Line[{{-1,-1},rwheel[6t + 1.75 Pi]}],

(*人間部分*)
Line[{{-0.7,-0.1},{-0.5,1.2}}],
Circle[{-0.4,1.35},0.2],
Line[{{-0.55,0.9},{-0.25,0.25},{-0.03,0.63}}],
Line[{{-0.55,0.9},{-0.25,0.4},{-0.03,0.63}}],

(*人間下半身部分*)
Line[{{-0.7,-0.1},{x1,y1},{lx[t],ly[t]}}],
Line[{{-0.7,-0.1},{x2,y2},{lx[t+Pi],ly[t+Pi]}}]
};

(*ボール*)
ball = {
{Thick,Disk[{ballx,ballz},0.2]}};

(*道路*)
road ={
{ Black, 
Polygon[{{-5, -1.6}, {-5, -2.5}, {4, -2.5}, {4, -1.6}, {-4, -1.6}}]}};

(*山*)
mountain = {Opacity[0.2],Black,Polygon[dmt[12]]};

(*ビル*)
bill = {Line[{{30-t,-1.6},{30-t,5}}],
Line[{{37-t,-1.6},{37-t,5}}],

(*窓*)
{Opacity[0.2],Black,Rectangle[{31-t,-1}]},
{Opacity[0.2],Black,Rectangle[{33-t,-1}]},
{Opacity[0.2],Black,Rectangle[{35-t,-1}]},

{Opacity[0.2],Black,Rectangle[{31-t,0.5}]},
{Opacity[0.2],Black,Rectangle[{33-t,0.5}]},
{Opacity[0.2],Black,Rectangle[{35-t,0.5}]},

{Opacity[0.2],Black,Rectangle[{31-t,2}]},
{Opacity[0.2],Black,Rectangle[{33-t,2}]},
{Opacity[0.2],Black,Rectangle[{35-t,2}]},

{Opacity[0.2],Black,Rectangle[{31-t,3.5}]},
{Opacity[0.2],Black,Rectangle[{33-t,3.5}]},
{Opacity[0.2],Black,Rectangle[{35-t,3.5}]},

Line[{{41.5-t,-1.6},{41.5-t,5}}],

{Opacity[0.2],Black,Rectangle[{37.5-t,-1.5}]},
{Opacity[0.2],Black,Rectangle[{39.5-t,-1.5}]},

{Opacity[0.2],Black,Rectangle[{37.5-t,0}]},
{Opacity[0.2],Black,Rectangle[{39.5-t,0}]},

{Opacity[0.2],Black,Rectangle[{37.5-t,1.5}]},
{Opacity[0.2],Black,Rectangle[{39.5-t,1.5}]},

{Opacity[0.2],Black,Rectangle[{37.5-t,3}]},
{Opacity[0.2],Black,Rectangle[{39.5-t,3}]}

};

(*東京スカイツリー*)
skytree = {Line[{{49-t,-1.6},{49.2-t,3}}],
Line[{{49.2-t,-1.6},{49.4-t,3}}],
Line[{{50-t,-1.6},{49.8-t,3}}],

{Opacity[0.8],Black,Polygon[{{49.1-t,3},{49-t,3.4},{50-t,3.4},{49.9-t,3}}]},

Line[{{49.2+1/60-t,3.4},{49.2+1/15-t,4}}],
Line[{{49.8-1/60-t,3.4},{49.8-1/15-t,4}}]
};

(*Text*)
start = {{Text[Style["Monochrome Animation!",Large],{7-0.7t,2.5}]},
{Text[Style["~僕の冒険~ 主演：棒人間",Medium],{6-0.7t,2}]},
{Text[Style["Fin.",Large],{40-0.7t,2.5}]}};

(*background*)
background = {

{If[t > 16.25Pi,{Opacity[0.2],Black,Polygon[{{-5,-2},{-5,4},{4,4},{4,-2}}]}]},
{If[t > 16Pi,{Opacity[0.175],Black,Polygon[{{-5,-2},{-5,4},{4,4},{4,-2}}]}]},
{If[t > 15.75Pi,{Opacity[0.15],Black,Polygon[{{-5,-2},{-5,4},{4,4},{4,-2}}]}]},
{If[t > 15.5Pi,{Opacity[0.125],Black,Polygon[{{-5,-2},{-5,4},{4,4},{4,-2}}]}]},{If[t > 15.25Pi,{Opacity[0.1],Black,Polygon[{{-5,-2},{-5,4},{4,4},{4,-2}}]}]},
{If[t > 15Pi,{Opacity[0.075],Black,Polygon[{{-5,-2},{-5,4},{4,4},{4,-2}}]}]},
{If[t > 14.5Pi,{Opacity[0.05],Black,Polygon[{{-5,-2},{-5,4},{4,4},{4,-2}}]}]},

};


gifs={};
Do[
gif=Graphics[{bike,road,ball,mountain,bill,start,skytree,background},
{PlotRange->{{-4,4},{-2,4}},AspectRatio->Automatic}(*,Axes->True*)];

AppendTo[gifs,gif];
Show[gif],
{t,0,20Pi,Pi/7}];

SetDirectory["C:\\Users\\ryusi\\Dropbox\\Mathematica Pre"]
Directory[]
Export["monochrome.gif",gifs]