program WalkingHuman; uses Graph, Crt; const handlen = 60; leglen = 80; length = 10; {Длина штриха} head = 30; u = 17; {Смещение земли} neck = 20; {Шея} ground = 390; {Уровень земли} step = 20; {Длина ступни} pause = 17500; {Задержка} stAng = pi/10; {Начальный угол} dfAng = pi/30; {Величина изменения угла} ratio = 2.5; {Сдвиг по фазе} var gd, gm, ec:integer; {Графика} k: integer; {Смещение земли} ang, stepAng, lapAng: real; {Углы} ascent: integer; {Подьем тела} shoulderX, shoulderY: integer;{Плечи} loinX, loinY: integer; {Пояс} lElbowX, lElbowY: integer; {Левый локоть} rElbowX, rElbowY: integer; {Правый локоть} rLapX, rLapY:integer; {Правое колено} lLapX, lLapY:integer; {Левое колено} lBrushX, lBrushY: integer; {Левая кисть} rBrushX, rBrushY: integer; {Правая кисть} lStepX, lStepY: integer; {Левая пятка} rStepX, rStepY: integer; {Правая пятка} lStep1X, lStep1Y: integer; {Левый носок} rStep1X, rStep1Y: integer; {Правый носок} procedure Earth(k:integer); {Рисование земли} var i:integer; begin Line(0, ground, GetMaxX, ground); for i:= 0 to 12 do Line(80*i - k, ground, 80*i - k, ground + length); end; procedure Body (head, shoulderX, shoulderY, loinX, loinY: integer); begin Circle(shoulderX, shoulderY - neck - head, head); Line(shoulderX, shoulderY - neck, loinX, loinY); end; procedure Hand (shoulderX, shoulderY, elbowX, elbowY, brushX, brushY, vHend:integer); begin Line(shoulderX, shoulderY, elbowX, elbowY); Line(elbowX, elbowY, brushX, brushY); end; procedure Leg (loinX, loinY, lapX, lapY, stepX, stepY, leglen, step1X, step1Y:integer; ang: real); begin Line(loinX, loinY, lapX, lapY); Line(lapX, lapY, stepX, stepY); Line(StepX, StepY, StepX + step, StepY); end; begin {Инициализация графики} gd:= Detect; InitGraph(gd, gm, ' '); ec:= GraphResult; if ec <> grOk then begin Writeln('Ошибка инициализации', GraphErrorMsg(ec)); Halt; end; {Рисование} shoulderX:= 320; shoulderY:= 120; loinX:= 320; loinY:= 230; repeat SetColor(White); OutTextXY(50, 50, 'Обычная походка'); ang:= pi/2 + stAng; k:=0; while ang > pi/3 do begin ang:= ang - dfAng; ascent:= Round(3*cos(5*ang)); SetColor(white); Earth(k); Body(head, shoulderX, shoulderY - ascent, loinX, loinY - ascent); lElbowX:= Round(shoulderX + handlen*cos(ang)); lElbowY:= Round(shoulderY + handlen*sin(ang) ); rElbowX:= Round(shoulderX + handlen*(-cos(ang-dfAng+dfAng*ratio))); rElbowY:= Round(shoulderY + handlen*(sin(ang-dfAng+dfAng*ratio)) ); lBrushX:= Round(shoulderX + 2*handlen*cos(ang-dfAng)); lBrushY:= Round(shoulderY + 2*handlen*sin(ang-dfAng) ); rBrushX:= Round(shoulderX + 2*handlen*(-cos(ang+dfAng*ratio))); rBrushY:= Round(shoulderY + 2*handlen*(sin(ang+dfAng*ratio)) ); lLapX:= Round(loinX + leglen*(cos(ang))); lLapY:= Round(loinY + leglen*(sin(ang)) ); rLapX:= Round(loinX + leglen*(-cos(ang+dfAng*ratio))); rLapY:= Round(loinY + leglen*(sin(ang+dfAng*ratio)) ); lStepX:= Round(loinX + 2*leglen*(cos(ang+dfAng))); lStepY:= Round(loinY + 2*leglen*(sin(ang+dfAng)) ); rStepX:= Round(loinX + 2*leglen*(-cos(ang-dfAng+dfAng*ratio))); rStepY:= Round(loinY + 2*leglen*(sin(ang-dfAng+dfAng*ratio)) ); Hand(shoulderX, shoulderY - ascent , lelbowX, lelbowY - ascent , lbrushX, lbrushY - ascent , handlen); Hand(shoulderX, shoulderY - ascent , relbowX, relbowY - ascent , rbrushX, rbrushY - ascent , handlen); Leg(loinX, loinY - ascent , lLapX, lLapY - ascent , lStepX, lStepY - ascent, lStep1X, lStep1Y - ascent, leglen, ang); Leg(loinX, loinY - ascent , rLapX, rLapY - ascent , rStepX, rStepY - ascent , rStep1X, rStep1Y - ascent, leglen, ang); Body(head, shoulderX, shoulderY - ascent, loinX, loinY - ascent); Delay(pause); SetColor(Black); Hand(shoulderX, shoulderY - ascent , lelbowX, lelbowY - ascent , lbrushX, lbrushY - ascent , handlen); Hand(shoulderX, shoulderY - ascent , relbowX, relbowY - ascent , rbrushX, rbrushY - ascent , handlen); Leg(loinX, loinY - ascent , lLapX, lLapY - ascent , lStepX, lStepY - ascent , lStep1X, lStep1Y - ascent, leglen, ang); Leg(loinX, loinY - ascent , rLapX, rLapY - ascent , rStepX, rStepY - ascent , rStep1X, rStep1Y - ascent, leglen, ang); Body(head, shoulderX, shoulderY - ascent, loinX, loinY - ascent); Earth(k); k:= k + u; end; until keypressed; ReadLn; CloseGraph; end.