home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / bix / rimbey.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1986-08-04  |  1.1 KB  |  44 lines

  1. program rimbey;
  2. var
  3.   xr,px,py,x,y,r,xi,yi,k:integer;
  4. const
  5.   xm=639;
  6.   ym=199;
  7. procedure fast(a,b,c,d,e:integer);external 'fastest.bin';
  8. procedure fastarc(x,y,color:integer);
  9. var i,j,k:integer;
  10. {$I fastarc.inc}
  11. begin
  12. for i:=sdata to edata do
  13. with data[i] do
  14.  
  15. {if y+i>=0 then if y+i<=ym then} {vertical clipping code commented out}
  16.  
  17. {if (x+x1<0) or (x+x2>xm) then
  18.  begin
  19.   j:=x+x1;if j<0 then j:=0;
  20.   k:=x+x2;if k>xm then k:=xm;
  21.   if j<=k then fast(j,y+i,k,y+i,color)
  22.  end
  23. else} {horizontal clipping code commented out}
  24.  
  25.   fast(x+x1,y+i,x+x2,y+i,color)
  26. end;
  27. begin
  28. HiRes;
  29.   x:=round(xm/2); y:=round(ym/2);
  30.   xi:=6; yi:=7; r:=10;xr:=23; {use 23 instead of 10 due to aspect ratio}
  31.   while not keypressed do begin
  32.     fastarc(x,y,1); {draws it}
  33.     px:=x;py:=y;
  34.     x:=x+xi; y:=y+yi;
  35.     if x>xm-xr then begin x:=xm-xr; xi:=-xi; end;
  36.     if x<xr    then begin x:=xr;    xi:=-xi; end;
  37.     if y>ym-r then begin y:=ym-r; yi:=-yi; end;
  38.     if y<r    then begin y:=r;    yi:=-yi; end;
  39.     {delay(50);} {add in your own delay, if needed, to have image last}
  40.     fastarc(px,py,0); {wipes it out}
  41.     end;
  42.     textmode;
  43.   end.
  44.