home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / fgl / fglight / expas.arj / TEMP / 13-07.PAS < prev    next >
Pascal/Delphi Source File  |  1995-01-31  |  799b  |  44 lines

  1. program main;
  2. uses fgmain, fgbitmap, fgmisc;
  3.  
  4. var
  5.   key, aux : byte;
  6.   old_mode : integer;
  7.   x, y     : integer;
  8.  
  9. begin
  10.   fg_initpm;
  11.   old_mode := fg_getmode;
  12.   fg_setmode(13);
  13.   fg_resize(640,400);
  14.  
  15.   fg_setcolor(2);
  16.   fg_rect(0,fg_getmaxx,0,fg_getmaxy);
  17.   fg_setcolor(15);
  18.   fg_box(0,fg_getmaxx,0,fg_getmaxy);
  19.   fg_justify(0,0);
  20.   fg_move(320,200);
  21.   fg_print('Press arrow keys to pan.',24);
  22.  
  23.   x := 0;
  24.   y := 0;
  25.  
  26.   repeat
  27.   begin
  28.     fg_getkey(key,aux);
  29.     if (aux = 72) and (y < 200) then
  30.       inc(y)
  31.     else if (aux = 75) and (x < 320) then
  32.       inc(x)
  33.     else if (aux = 77) and (x > 0) then
  34.       dec(x)
  35.     else if (aux = 80) and (y > 0) then
  36.       dec(y);
  37.     fg_pan(x,y);
  38.   end;
  39.   until (key = 27);
  40.  
  41.   fg_setmode(old_mode);
  42.   fg_reset;
  43. end.
  44.