home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / fgl / fglight / expas.arj / TEMP / 12-03.PAS < prev    next >
Pascal/Delphi Source File  |  1995-01-20  |  772b  |  45 lines

  1. program main;
  2. uses fgmain, fgmisc;
  3.  
  4. var
  5.   old_mode : integer;
  6.   x        : integer;
  7.  
  8. begin
  9.  
  10.   { initialize the video environment }
  11.  
  12.   fg_initpm;
  13.   if (fg_testmode(13,1) = 0) then
  14.   begin
  15.     writeln('This program requires EGA.');
  16.     exit;
  17.   end;
  18.   old_mode := fg_getmode;
  19.   fg_setmode(13);
  20.   fg_setfunc(3);
  21.  
  22.   { draw some type of background }
  23.  
  24.   fg_setcolor(15);
  25.   fg_rect(0,319,0,199);
  26.  
  27.   { move the object across the screen }
  28.  
  29.   fg_setcolor(10 xor 15);
  30.   for x := -20 to 319 do
  31.   begin
  32.     if (x mod 5 = 0) then
  33.     begin
  34.       fg_clprect(x,x+19,95,104);
  35.       fg_waitfor(1);
  36.       fg_clprect(x,x+19,95,104);
  37.     end;
  38.   end;
  39.  
  40.   { restore the original video mode and return to DOS }
  41.  
  42.   fg_setmode(old_mode);
  43.   fg_reset;
  44. end.
  45.