home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / GFXFX2.ZIP / BOUNCE.PAS < prev    next >
Pascal/Delphi Source File  |  1995-02-14  |  611b  |  25 lines

  1.  
  2. program bounce; { BOUNCE.PAS }
  3. { "How to generate 'realistic' bounce", by Bas van Gaalen }
  4. uses u_vga;
  5. const idiv=2;
  6. var j:real; i,pi,px,py,x,y:integer; dir:shortint;
  7. begin
  8.   setvideo($13);
  9.   x:=10; y:=0; dir:=1; i:=190;
  10.   while i>0 do begin
  11.     j:=-sqrt(i);
  12.     while j<sqrt(i) do begin
  13.       y:=round(sqr(j));
  14.       px:=x; py:=y; pi:=i;
  15.       putpixel(x,y+(190-i),15);
  16.       inc(x,dir); if (x>310) or (x<10) then dir:=-dir;
  17.       j:=j+0.2;
  18.       vretrace;
  19.       putpixel(px,y+(190-pi),0);
  20.     end;
  21.     if (i div idiv)=0 then i:=0 else dec(i,i div idiv);
  22.   end;
  23.   setvideo(u_lm);
  24. end.
  25.