@Juhas: jak już wspomniałem jest to projekt studencki oparty o TTimer i TPaintBox. W zdarzeniu OnTimer jest taki kodzik:
procedure TForm1.Timer1Timer(Sender: TObject);
const x:integer=6;
y:integer=6;
krokx:integer=6;
kroky:integer=6;
begin
with PaintBox1.Canvas do
begin
//czyszczenie prostokąta
Brush.Color:=clWhite;
Rectangle(0,0,200,200);
//obliczenie współrzędnych
x:=x+krokx;
y:=y+kroky;
//rysowanie koła w kwadracie o boku
// równym 6 pikseli
Brush.Color:=clBlue;
Ellipse(x-6, y-6, x+6, y+6);
if (x>Paintbox1.Width-6) then
begin
krokx:=6+Random(5);
krokx:=-krokx;
end;
if (y>Paintbox1.Height-6) then
begin
kroky:=6+Random(5);
kroky:=-kroky;
end;
if (x<=6) then krokx:=-krokx;
if (y<=6) then kroky:=-kroky;
end; //with
end;
brzydal straszny ale działa ;)