{$A+,B-,E+,F-,G+,N+,Q-,R-,S-}

Program skycredits;

Uses crush13h,CRT;

Const
        ZInc = 25;
        ZOfs = 256;
        ZScale = 256;
        Sc = 0.7;


type verts= record
                   x,y,z:real;
                   color:integer;
            end;
     lines= record
                   v1,v2:word;
                   color:integer;
            end;

Var     Vert : Array[0..100] Of verts;
        VLine : Array[0..100] Of lines;
        Vertn,linen,n:word;
        Ch : Char;
        a,b:integer;
        ang: real;
        count:integer;

Procedure Drawverts (where:word);
Var SX, SY, n : Word;
Begin
     n := 0;
     Repeat
           With Vert[n] Do
                 Begin
                         SX := Round((ZScale*X)/(Z-ZOfs));
                         SY := Round((ZScale*Y)/(Z-ZOfs));
                         if 160+sx>-1 then if 160+sx<320 then if 100-sy>-1 then if 100-sy<200 then
                            putpixel (160+SX, 100-SY, color, where);


                 End;
           n := n + 1;
     Until n = Vertn;
End;

Procedure Drawlines (where:word);
Var SX1, SY1, SX2, SY2, n : Word;
Begin
     n := 0;
     Repeat
           SX1 := Round((ZScale*vert[vline[n].v1].x)/(vert[vline[n].v1].Z-ZOfs));
           SY1 := Round((ZScale*vert[vline[n].v1].Y)/(vert[vline[n].v1].Z-ZOfs));
           SX2 := Round((ZScale*vert[vline[n].v2].X)/(vert[vline[n].v2].Z-ZOfs));
           SY2 := Round((ZScale*vert[vline[n].v2].Y)/(vert[vline[n].v2].Z-ZOfs));
           line (160+SX1, 100-SY1, 160+SX2, 100-SY2, vline[n].color, where);
           n := n + 1;
     Until n = linen;
End;

Procedure Rotate(Var X, Y, ang : Real);
        Var XX, YY : Real;
        Begin
           XX := X*Cos(ang)+Y*Sin(ang);
      YY := Y*Cos(ang)-X*Sin(ang);
      X := XX;
      Y := YY;
   End;


Begin
     video_mode( $13);
     initvirt;
      With Vert[0] Do
           Begin
              X := 50-160;
              Y := 100-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[1] Do
           begin
              X := 70-160;
              Y := 100-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[2] Do
           begin
              X := 90-160;
              Y := 80-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[3] Do
           begin
              X := 110-160;
              Y := 80-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           End;
      With Vert[4] Do
           Begin
              X := 90-160;
              Y := 120-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[5] Do
           Begin
              X := 110-160;
              Y := 120-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;

      With Vert[6] Do
           Begin
              X := 130-160;
              Y := 80-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[7] Do
           Begin
              X := 150-160;
              Y := 80-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[8] Do
           Begin
              X := 130-160;
              Y := 120-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[9] Do
           Begin
              X := 150-160;
              Y := 120-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[10] Do
           Begin
              X := 170-160;
              Y := 80-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[11] Do
           Begin
              X := 190-160;
              Y := 85-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[12] Do
           Begin
              X := 170-160;
              Y := 120-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[13] Do
           Begin
              X := 190-160;
              Y := 115-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[14] Do
           Begin
              X := 210-160;
              Y := 80-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[15] Do
           Begin
              X := 230-160;
              Y := 80-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[16] Do
           Begin
              X := 210-160;
              Y := 100-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[17] Do
           Begin
              X := 220-160;
              Y := 100-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[18] Do
           Begin
              X := 210-160;
              Y := 120-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[19] Do
           Begin
              X := 230-160;
              Y := 120-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[20] Do
           Begin
              X := 250-160;
              Y := 100-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[21] Do
           Begin
              X := 270-160;
              Y := 100-100;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;

      vline[0].v1:=0;
      vline[0].v2:=1;
      vline[0].color:=250;

      vline[1].v1:=2;
      vline[1].v2:=3;
      vline[1].color:=250;

      vline[2].v1:=2;
      vline[2].v2:=4;
      vline[2].color:=250;

      vline[3].v1:=4;
      vline[3].v2:=5;
      vline[3].color:=250;

      vline[4].v1:=6;
      vline[4].v2:=7;
      vline[4].color:=250;

      vline[5].v1:=7;
      vline[5].v2:=9;
      vline[5].color:=250;

      vline[6].v1:=8;
      vline[6].v2:=9;
      vline[6].color:=250;

      vline[7].v1:=6;
      vline[7].v2:=8;
      vline[7].color:=250;

      vline[8].v1:=10;
      vline[8].v2:=11;
      vline[8].color:=250;

      vline[9].v1:=11;
      vline[9].v2:=13;
      vline[9].color:=250;

      vline[10].v1:=12;
      vline[10].v2:=13;
      vline[10].color:=250;

      vline[11].v1:=10;
      vline[11].v2:=12;
      vline[11].color:=250;

      vline[12].v1:=14;
      vline[12].v2:=15;
      vline[12].color:=250;

      vline[13].v1:=16;
      vline[13].v2:=17;
      vline[13].color:=250;

      vline[14].v1:=14;
      vline[14].v2:=18;
      vline[14].color:=250;

      vline[15].v1:=18;
      vline[15].v2:=19;
      vline[15].color:=250;

      vline[16].v1:=20;
      vline[16].v2:=21;
      vline[16].color:=250;


   Vertn := 22;
   linen := 17;
   setcolor (250,63,63,63);
   ang:= Pi/72;

   Repeat
              cls (0,vp[1]);
              DrawVerts(vp[1]);
              drawlines(vp[1]);
              for a:=0 to 256 do putpixel (a,0,a,vp[1]);
              waitvbl;
              move (mem[vp[1]:0],mem[vga:0],64000);

              for a:=0 to vertn do
              begin
                   With Vert[a] Do Rotate(X, Y, ang);
              end;

   Until KeyPressed;

    With Vert[0] Do
           Begin
              X := -90;
              Y := 0;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[1] Do
           begin
              X := -70;
              Y := 0;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[2] Do
           begin
              X := -50;
              Y := 20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[3] Do
           begin
              X := -30;
              Y := 20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           End;
      With Vert[4] Do
           Begin
              X := -50;
              Y := -20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[5] Do
           Begin
              X := -30;
              Y := -20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;

      With Vert[6] Do
           Begin
              X := -30;
              Y := 0;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[7] Do
           Begin
              X := -40;
              Y := 0;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[8] Do
           Begin
              X := -10;
              Y := 20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[9] Do
           Begin
              X := 10;
              Y := 20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[10] Do
           Begin
              X := -10;
              Y := 0;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[11] Do
           Begin
              X := 0;
              Y := 0;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[12] Do
           Begin
              X := -10;
              Y := -20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[13] Do
           Begin
              X := 30;
              Y := 20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[14] Do
           Begin
              X := 50;
              Y := 20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[15] Do
           Begin
              X := 30;
              Y := -20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[16] Do
           Begin
              X := 50;
              Y := -20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[17] Do
           Begin
              X := 70;
              Y := 0;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[18] Do
           Begin
              X := 90;
              Y := 0;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;

      vline[0].v1:=0;
      vline[0].v2:=1;
      vline[0].color:=250;

      vline[1].v1:=2;
      vline[1].v2:=3;
      vline[1].color:=250;

      vline[2].v1:=2;
      vline[2].v2:=4;
      vline[2].color:=250;

      vline[3].v1:=4;
      vline[3].v2:=5;
      vline[3].color:=250;

      vline[4].v1:=5;
      vline[4].v2:=6;
      vline[4].color:=250;

      vline[5].v1:=6;
      vline[5].v2:=7;
      vline[5].color:=250;

      vline[6].v1:=8;
      vline[6].v2:=9;
      vline[6].color:=250;

      vline[7].v1:=8;
      vline[7].v2:=12;
      vline[7].color:=250;

      vline[8].v1:=10;
      vline[8].v2:=11;
      vline[8].color:=250;

      vline[9].v1:=13;
      vline[9].v2:=16;
      vline[9].color:=250;

      vline[10].v1:=14;
      vline[10].v2:=15;
      vline[10].color:=250;

      vline[11].v1:=17;
      vline[11].v2:=18;
      vline[11].color:=250;

   Vertn := 19;
   linen := 12;

   Repeat Ch := ReadKey Until Not KeyPressed;
   n := 150;

   Repeat
              cls (0,vp[1]);
              DrawVerts(vp[1]);
              drawlines(vp[1]);
              for a:=0 to 256 do putpixel (a,0,a,vp[1]);
              waitvbl;
              move (mem[vp[1]:0],mem[vga:0],64000);

              for a:=0 to vertn do
              begin
                   With Vert[a] Do Rotate(X, Y, ang);
              end;

   Until KeyPressed;

      With Vert[0] Do
           Begin
              X := -120;
              Y := 0;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[1] Do
           begin
              X := -100;
              Y := 0;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[2] Do
           begin
              X := -80;
              Y := 20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[3] Do
           begin
              X := -70;
              Y := 0;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           End;
      With Vert[4] Do
           Begin
              X := -60;
              Y := 20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[5] Do
           Begin
              X := -80;
              Y := -20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;

      With Vert[6] Do
           Begin
              X := -60;
              Y := -20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[7] Do
           Begin
              X := -40;
              Y := 20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[8] Do
           Begin
              X := -20;
              Y := 20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[9] Do
           Begin
              X := -40;
              Y := -20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[10] Do
           Begin
              X := -20;
              Y := -20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[11] Do
           Begin
              X := 0;
              Y := 20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[12] Do
           Begin
              X := 20;
              Y := 20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[13] Do
           Begin
              X := 0;
              Y := 0;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[14] Do
           Begin
              X := 20;
              Y := 0;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[15] Do
           Begin
              X := 0;
              Y := -20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[16] Do
           Begin
              X := 20;
              Y := -20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[17] Do
           Begin
              X := 40;
              Y := 20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[18] Do
           Begin
              X := 40;
              Y := -20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[19] Do
           Begin
              X := 60;
              Y := 20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[20] Do
           Begin
              X := 80;
              Y := 20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[21] Do
           Begin
              X := 60;
              Y := -20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[22] Do
           Begin
              X := 80;
              Y := -20;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;

      With Vert[23] Do
           Begin
              X := 100;
              Y := 0;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;
      With Vert[24] Do
           Begin
              X := 120;
              Y := 0;
              Z := 0;
                   X := X * Sc;
                   Y := Y * Sc;
                   Z := Z * Sc;
                   color:=250;
           end;


      vline[0].v1:=0;
      vline[0].v2:=1;
      vline[0].color:=250;

      vline[1].v1:=2;
      vline[1].v2:=3;
      vline[1].color:=250;

      vline[2].v1:=3;
      vline[2].v2:=4;
      vline[2].color:=250;

      vline[3].v1:=2;
      vline[3].v2:=5;
      vline[3].color:=250;

      vline[4].v1:=4;
      vline[4].v2:=6;
      vline[4].color:=250;

      vline[5].v1:=7;
      vline[5].v2:=9;
      vline[5].color:=250;

      vline[6].v1:=8;
      vline[6].v2:=10;
      vline[6].color:=250;

      vline[7].v1:=9;
      vline[7].v2:=10;
      vline[7].color:=250;

      vline[8].v1:=11;
      vline[8].v2:=12;
      vline[8].color:=250;

      vline[9].v1:=11;
      vline[9].v2:=13;
      vline[9].color:=250;

      vline[10].v1:=13;
      vline[10].v2:=14;
      vline[10].color:=250;

      vline[11].v1:=14;
      vline[11].v2:=16;
      vline[11].color:=250;

      vline[12].v1:=16;
      vline[12].v2:=15;
      vline[12].color:=250;

      vline[13].v1:=17;
      vline[13].v2:=18;
      vline[13].color:=250;

      vline[14].v1:=19;
      vline[14].v2:=20;
      vline[14].color:=250;

      vline[15].v1:=19;
      vline[15].v2:=21;
      vline[15].color:=250;

      vline[16].v1:=21;
      vline[16].v2:=22;
      vline[16].color:=250;

      vline[17].v1:=23;
      vline[17].v2:=24;
      vline[17].color:=250;

   Vertn := 25;
   linen := 18;

   Repeat Ch := ReadKey Until Not KeyPressed;
   n := 150;

   Repeat
              cls (0,vp[1]);
              DrawVerts(vp[1]);
              drawlines(vp[1]);
              for a:=0 to 256 do putpixel (a,0,a,vp[1]);
              waitvbl;
              move (mem[vp[1]:0],mem[vga:0],64000);

              for a:=0 to vertn do
              begin
                   With Vert[a] Do Rotate(X, Y, ang);
              end;

   Until KeyPressed;



   Repeat Ch := ReadKey Until Not KeyPressed;
   n := 150;

   Repeat
      cls (0,vp[1]);
      DrawVerts(vp[1]);
      Drawlines(vp[1]);
      move (mem[vp[1]:0],mem[vga:0],64000);

      for a:=0 to vertn do
              begin
                   With Vert[a] Do
                        begin
                             X := X * 0.95;
                             Y := Y * 0.95;
                        end;
                   With Vert[a] Do Rotate(X, Z, ang);
                   With Vert[a] Do Rotate(Y, X, ang);
                   With Vert[a] Do Rotate(Z, Y, ang);
              end;

      n := n - 1;
   Until (n = 0) Or KeyPressed;
   If KeyPressed Then Repeat Ch := ReadKey Until Not KeyPressed;

   Video_Mode( 03);
End.