home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / WGT_TC21.ZIP / INVADE2.C < prev    next >
C/C++ Source or Header  |  1992-07-17  |  2KB  |  78 lines

  1. #include <stdio.h>
  2. #include <dos.h>
  3. #include <conio.h>
  4. #include <stdlib.h>
  5. #include <alloc.h>
  6. #include "c:\tc\wgt\wgt.h"
  7. #include "c:\tc\wgt\spr.h"
  8.  
  9. block title;                // the title screen
  10.  
  11. color palette[256];
  12. block sprites[201];
  13. int x,y,i;
  14.  
  15. void looper();
  16.  
  17. void main(void)
  18. {
  19. printf("WordUp Graphics Toolkit Example Program\n\n");
  20. printf("This program is meant to show off what the\n");
  21. printf("WGT Library can do, and is not meant as a\n");
  22. printf("complete shareware or public domain game.\n");
  23. printf("Please remember this while playing the game.\n\n\n");
  24.  
  25.  
  26. i=minit();
  27. if (i==0)
  28.    {
  29.    printf("Mouse not detected.  You need a mouse for this example program\n");
  30.    printf("Press any key\n");
  31.    getch();
  32.    exit(1);
  33.    }
  34. else printf("Mouse with %i buttons detected.\n",i);
  35. printf("Press any key\n");
  36. getch();
  37.  
  38. vga256();
  39. title=wloadpak("c:\\tc\\wgt\\invade.pak");            // load the title screen
  40. wloadsprites(&palette,"c:\\tc\\wgt\\invader.spr",sprites);
  41. initspr();
  42. spon=1;
  43.  
  44. wsetscreen(spritescreen);
  45.  
  46. wputblock(0,0,title,0);                // show the title
  47. wcopyscreen(0,0,319,199,spritescreen,0,0,NULL);
  48.  
  49. getch();                    // wait for a key
  50.  
  51. wsetcolor(0);                    // blank out the title
  52. wbar(0,0,319,140);
  53. wcopyscreen(0,0,319,199,spritescreen,0,0,NULL);
  54.  
  55. spriteon(1,160,148,1);                // start the game
  56. msetbounds(0,148,319,148);
  57.  
  58. do {
  59. looper();
  60. } while (but!=2);
  61.  
  62. msetbounds(0,0,319,199);
  63. textmode(C80);
  64. }
  65.  
  66.  
  67. void looper(void)
  68. {
  69. erasespr();
  70.  
  71. mread();
  72. s[1].x=mx;
  73. s[1].y=my;
  74.  
  75. drawspr();
  76. }
  77.  
  78.