home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / w / wgt3_ex.zip / FLI04.C < prev    next >
C/C++ Source or Header  |  1992-09-17  |  1KB  |  74 lines

  1. #include <conio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4. #include <wgt.h>
  5. #include <wgtfli.h>
  6. #include <spr.h>
  7.  
  8. // WordUp Graphics Toolkit FLI demo program
  9. // Show how to display sprites overtop an animating FLI.
  10.  
  11. block sprites[201];
  12. color palette[256];
  13. int i;
  14.  
  15.  
  16. void main(void)
  17. {
  18.      randomize();
  19.      vga256();
  20.      wloadsprites(&palette,"bird.spr",sprites);
  21.      initspr();
  22.      fliscreen=spritescreen;
  23.      spon=5;
  24.      spclip=1;
  25.  
  26.     for (i=1; i<5; i++)
  27.      {
  28.      spriteon(i,320+rand() % 50,rand() % 170,1);
  29.      animate(i,"(1,1)(2,1)(3,1)(2,1)R");             
  30.      animon(i);
  31.      }
  32.  
  33.      movex(1,"(-1,400,0)R"); 
  34.      movex(2,"(-2,400,0)R"); 
  35.      movex(3,"(-3,400,0)R"); 
  36.      movex(4,"(-4,400,0)R"); 
  37.      movexon(1);
  38.      movexon(2);
  39.      movexon(3);
  40.      movexon(4);
  41.  
  42.      movey(1,"(-1,200,3)R"); 
  43.      movey(2,"(1,200,2)R"); 
  44.      movey(3,"(1,400,1)R"); 
  45.      moveyon(1);
  46.      moveyon(2);
  47.      moveyon(3);
  48.  
  49.  
  50.      openfli("wordup.fli");
  51.  
  52.  
  53.      nextframe();
  54.      copyfli();
  55.  
  56.      do {
  57.      erasespr();
  58.      nextframe();
  59.      drawspr();
  60.      copyfli();
  61.      for (i=1; i<5; i++)
  62.        if (s[i].x<-40)
  63.      {
  64.      s[i].x=320+rand() % 50;
  65.      s[i].y=rand() % 170;
  66.      }
  67.      }while (!kbhit());
  68.      getch();
  69.      closefli();
  70.      wfreesprites(sprites);
  71.      textmode(C80);
  72. }
  73.  
  74.