home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / fgl / fglight / exc.arj / TEMP / 15-07.C < prev    next >
Text File  |  1995-01-20  |  650b  |  37 lines

  1. #include <fastgraf.h>
  2.  
  3. void main(void);
  4.  
  5. #define ESC 27
  6.  
  7. void main()
  8. {
  9.    int color;
  10.    int old_mode;
  11.    unsigned char key, aux;
  12.  
  13.    fg_initpm();
  14.    old_mode = fg_getmode();
  15.    fg_setmode(fg_automode());
  16.    color = 0;
  17.  
  18.    fg_musicb("O4 L16 CC#DD#EFF#GG#AA#B O+ CC#DD#EFF#GG#AA#B$",-1);
  19.  
  20.    while (fg_playing())
  21.    {
  22.       color = (color + 1) & 15;
  23.       fg_setcolor(color);
  24.       fg_rect(0,fg_getmaxx(),0,fg_getmaxy());
  25.  
  26.       fg_waitfor(4);
  27.       fg_intkey(&key,&aux);
  28.       if (key == ESC)
  29.          fg_hush();
  30.       else if (key+aux != 0)
  31.          fg_hushnext();
  32.    }
  33.  
  34.    fg_setmode(old_mode);
  35.    fg_reset();
  36. }
  37.