home *** CD-ROM | disk | FTP | other *** search
/ Rat's Nest 1 / ratsnest1.iso / incoming / pas_sors.arj / KRU$H02.PAS < prev    next >
Pascal/Delphi Source File  |  1994-12-17  |  4KB  |  82 lines

  1. program bullshit_bouncy;
  2. uses graph, crt;
  3. var max, may, x, y, a, b, count, old : integer;
  4.  
  5. {   This is version 0.01ßeta of Bull$hit_Bouncy,   }
  6. {   and is brought to you by Kru$H Productions.    }
  7. {   It is a very simple piece of Pascal.           }
  8. {   You may distribute this program as much as     }
  9. {   you wish, although I would appreciate it if    }
  10. {   you would not distribute it after it has been  }
  11. {   modified.                -Kru$H                }
  12.  
  13.  
  14. procedure initialize;                        {This procedure initializes    }
  15. var  GDriv : integer;                        {the Graphics mode             }
  16.      GMode : integer;                        {...                           }
  17. begin                                        {...                           }
  18.   clrscr; randomize;                         {...                           }
  19.   GDriv := Detect;                           {...                           }
  20.   InitGraph (Gdriv, Gmode, '');              {...                           }
  21. end;
  22.  
  23.  
  24.  
  25. procedure draw_screen;
  26. var oldx : array [0..500] of integer;
  27.     oldy : array [0..500] of integer;
  28.  
  29. begin
  30.  max:= GetMaxX;
  31.  may:= GetMaxY;
  32.  x:= (GetMaxX div 2);
  33.  y:= (GetMaxY div 2);
  34.  count:= 0;
  35.  repeat
  36.  
  37.    {  oldx[500] := x ;   oldy[500] := y;   } {Use this if you want to clear }
  38.    {  for old := 0 to 499 do begin         } {old ellipses. It takes in all }
  39.    {  oldx[old] := oldx[(old+1)];          } {of the old coordinates and    }
  40.    {  oldy[old] := oldy[(old+1)];          } {moves them one step towards   }
  41.    {   end;                                  {the number zero.              }
  42.  
  43.    SetColor (random(GetMaxColor));           {Set a new color.              }
  44.    Ellipse (x,y, 0, 360, 30, 30);            {Draw next ellipse.            }
  45.    OutTextXY (25,10,' Circle Magic ');       {Type all "necessary" text,    }
  46.    OutTextXY ((max-190),(may-20),            {in current color.             }
  47.       'by: Kru$H Productions');              {...                           }
  48.    MoveTo      ( 15, 30);                    {Draw borders,                 }
  49.    LineTo ((max-15), 30);                    {also in current color         }
  50.    LineTo ((max-15),(may-30));               {...                           }
  51.    LineTo      ( 15,(may-30));               {...                           }
  52.    LineTo      ( 15, 30);                    {...                           }
  53.  
  54.  
  55.    {  SetColor (Black);                    } {Use this if you want to clear }
  56.    {  SetFillStyle(SolidFill, Black);      } {old ellipses. It makes a new  }
  57.    {  FillEllipse(oldx[1],oldy[1],30,30);  } {black ellipse over the old 1. }
  58.  
  59.    x := x-5+ (random(11));                   {New coordinates for the       }
  60.    y := y-5+ (random(11));                   {next ellipse.                 }
  61.  
  62.    if x<55 then x:=55;                       {Stop ellipses from going past }
  63.    if x>(max-55) then x :=(max-55);          {the borders of the screen.    }
  64.    if y<75 then y:=75;                       {...                           }
  65.    if y>(may-75) then y :=(may-75);          {...                           }
  66.  
  67.    {  count:=count+1              }          {Add one to counter.}
  68.    {  if count> 25000 then begin  }          {Use this if you want to clear }
  69.    {  ClearViewPort;              }          {the screen at intervals       }
  70.    {  count:=0;                   }          {...                           }
  71.    {  end;                        }          {...                           }
  72.  
  73.  until KeyPressed;                           {Stop procedure.               }
  74. end;
  75.  
  76.  
  77.  
  78. begin                                        {main program                  }
  79.   initialize;
  80.   draw_screen;
  81.   closegraph;
  82. end.