Форум для программистов - задавайте интересные вопросы - получайте квалифицированные ответы
  • AsemAsem December 2011
    Соеденить 2 анимайи при нажатие enter переходила на другую анимацию
    uses crt,GraphABC;
    procedure popriguncik;
    var
    w,i,pic,x,y,y1: integer;

    var x0,y0,x2,y2,u,j,R: integer;
    xz: array [1..100] of integer;
    yz: array [1..100] of integer;
    begin
    setwindowsize(500,500);
    x:=70;y:=1;
    pic:=LoadPicture('001.png');
    line(0,450,400,450);

    {down}
    i:=1;
    repeat
    i:=i+1;
    DrawPicture(pic,x,i,50,50);
    sleep(1);
    until i=400;
    {up}
    i:=400;
    repeat
    i:=i-1;
    if (i mod 5)=0 then x:=x+1;
    DrawPicture(pic,x,i,50,50);
    sleep(1);
    until i=200;
    {down}
    i:=200;
    repeat
    i:=i+1;
    if (i mod 5)=0 then x:=x+1;
    DrawPicture(pic,x,i,50,50);
    sleep(1);
    until i=400;
    {up}
    i:=400;
    repeat
    i:=i-1;
    if (i mod 5)=0 then x:=x+1;
    DrawPicture(pic,x,i,50,50);
    sleep(1);
    until i=300;

    i:=300;
    repeat
    i:=i+1;
    if (i mod 5)=0 then x:=x+1;
    DrawPicture(pic,x,i,50,50);
    sleep(1);
    until i=400;

    i:=400;
    repeat
    i:=i-1;
    if (i mod 5)=0 then x:=x+1;
    DrawPicture(pic,x,i,50,50);
    sleep(1);
    until i=350;

    i:=350;
    repeat
    i:=i+1;
    if (i mod 5)=0 then x:=x+1;
    DrawPicture(pic,x,i,50,50);
    sleep(1);
    until i=400;

    i:=400;
    repeat
    i:=i-1;
    if (i mod 5)=0 then x:=x+1;
    DrawPicture(pic,x,i,50,50);
    sleep(1);
    until i=360;

    i:=360;
    repeat
    i:=i+1;
    if (i mod 5)=0 then x:=x+1;
    DrawPicture(pic,x,i,50,50);
    sleep(1);
    until i=400;
    i:=400;
    repeat
    i:=i-1;
    if (i mod 5)=0 then x:=x+1;
    DrawPicture(pic,x,i,50,50);
    sleep(1);
    until i=390;
    i:=390;
    repeat
    i:=i+1;
    if (i mod 5)=0 then x:=x+1;
    DrawPicture(pic,x,i,50,50);
    sleep(1);
    until i=400;
    for i:=x to 800 do begin drawpicture(pic,i,400,50,50);sleep(1);end;
    end;






    procedure Sun;
    begin
    popriguncik;
    setbrushcolor(clyellow);
    setpencolor(clyellow);
    circle(x0,y0,50);
    sleep(10);
    end;

    procedure Zemla;
    begin
    setpencolor(clnavy);
    setbrushcolor(clnavy);
    circle(x,y,20);
    end;

    begin
    lockdrawing;
    Hidecursor;
    setwindowsize(500,400);

    for i:=1 to 100 do
    begin
    xz[i]:=random(500);
    yz[i]:=random(400);
    setbrushcolor(clwhite);
    end;
    x0:=250; y0:=200; R:=150;
    repeat
    for u:=1 to 360 do
    begin
    clearwindow (clblack);
    for i:=1 to 100 do
    begin
    setbrushcolor(clwhite);
    circle(xz[i],yz[i],2);
    end;
    Sun;
    x:=round(x0+R*cos(pi*u/180));
    y:=round(y0+R*sin(pi*u/180));
    Zemla;
    sleep(10);
    redraw;
    end;
    until keypressed;


    end.