< -->

Program Balloon;
{$D-,G+}
Uses Graph, CRT;
var
  D, R, e : Integer;
  i, dl  : Word;
  x, y, xp, yp : Word;
  x1, y1, xp1, yp1 : Word;
  x2, y2, xp2, yp2 : Word;
  u, uu : Real;
Procedure Lights;
var x, y, x1, y1, j : Word;
begin
  SetColor(Yellow);
  SetFillStyle(1, Yellow);
  FillEllipse(50, 50, 30, 30);
  for j := 0 to 89 do
  begin
   dl := Random(Random(30));
   uu := 0.01*j;
   x := Round(35*cos(7*uu )+50);
   y := Round(35*sin(7*uu)+50);
   x1 := Round((50+1.0*dl)*cos(7*uu )+50);
   y1 := Round((50+1.0*dl)*sin(7*uu)+50);
   Line( x, y, x1, y1);
  end;
  SetColor(LightCyan);
  SetFillStyle(1, LightCyan);
  FillEllipse(350, 60, 40, 40);
  SetColor(Cyan);
  SetFillStyle(1, Cyan);
  FillEllipse(410, 80, 50, 35);
  SetColor(LightBlue);
  SetFillStyle(1, LightBlue);
  FillEllipse(480, 70, 45, 37);
end;
{------------------------}
begin
  Randomize;
  InitGraph(D, R, '');
  e := GraphResult;
  if e <> 0 then
    begin
     WriteLn('Ошибка графики: ', GraphErrorMsg(e));
     Halt;
    end;
  SetFillStyle(1, Blue);
  FloodFill(1,1,1);
  for i := 0 to 639 do
  begin
   dl := Random(Random(30));
    case dl and 1 of
     0: SetColor(Green);
     1: SetColor(LightGreen);
    end;
   Line(i,479,i,450-dl);
  end;
  Lights;
  SetColor(Yellow);
  OutTextXY(10, 455, 'Okrugin''s BALLOONS. 1998 (Shyar@v.ru, Shyar@list.ru)    <|=)) ');
  SetColor(Brown);
  OutTextXY(10, 469, 'If you see it in WINOWS'' window - press Alt+Enter');
  SetColor(LightBlue);
  OutTextXY(410, 462, 'The best in the WORLD!!!');
  u := 0.0;
  While not KeyPressed do
  begin
   u := u + 0.008;
   xp := x;
   yp := y;
   x := Round(300*cos(11*u )+320);
   y := Round(-180*sin(15*u)+210);
   xp1 := x1;
   yp1 := y1;
   x1 := Round(300*cos(17*u )+320);
   y1 := Round(-180*sin(14*u)+210);
   xp2 := x2;
   yp2 := y2;
   x2 := Round(300*cos(31*u )+320);
   y2 := Round(-180*sin(29*u)+210);
   SetColor(Blue);
   SetFillStyle(1, Blue);
   Line(520, 430, xp, yp+20);
   Line(220, 430, xp1, yp1+25);
   Line(320, 430, xp2, yp2+25);
   FillEllipse(xp, yp, 20, 20);
   FillEllipse(xp1, yp1, 15, 25);
   FillEllipse(xp2, yp2, 10, 25);
   SetColor(LightGray);
   Line(220, 430, x1, y1+25);
   Line(320, 430, x2, y2+25);
   Line(520, 430, x, y+20);
   SetFillStyle(1, LightRed);
   SetColor(LightRed);
   FillEllipse(x1, y1, 15, 25);
   SetFillStyle(1, Red);
   SetColor(Red);
   FillEllipse(x2, y2, 10, 25);
   SetFillStyle(1, LightMagenta);
   SetColor(Magenta);
   FillEllipse(x, y, 20, 20);
   Delay(100);
   Lights;
  end;
  CloseGraph;
end.

Назад