home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / b / boodfly.zip / BOODTEST.CPP < prev    next >
C/C++ Source or Header  |  1992-10-28  |  2KB  |  74 lines

  1. #include "xlib.h"
  2. #include "xtext.h"
  3. #include "xrect.h"
  4. #include <conio.h>
  5. #include <stdlib.h>
  6. #include <stdio.h>
  7. #include <alloc.h>
  8. #ifndef ANIMAP.H
  9. #include "animap.h"
  10. #endif
  11. #ifndef ACTOR.H
  12. #include "actor.h"
  13. #endif
  14. #ifndef EVENT.H
  15. #include "event.h"
  16. #endif
  17. #ifndef FACTOR.H
  18. #include "factor.h"
  19. #endif
  20. #include "boodles.h"
  21. #include "boodmisc.h"
  22.  
  23. extern int score;
  24. extern int turns;
  25. extern int numboodles, numgrumjugs;
  26. extern boodlepiece ** boodles;
  27. extern boodlepiece ** grumjugs;
  28.  
  29. void main(int argcount, char ** argvector)
  30. {
  31.   int boodlepoints = 35;
  32.   int grumpoints = 36;
  33.   if (argcount == 3)
  34.   {
  35.     boodlepoints = atoi(argvector[1]);
  36.     grumpoints = atoi(argvector[2]);
  37.   }
  38.   randomize();
  39.   int randomnum, hitcounter = 0;
  40.   boodlepiece * target;
  41.   x_set_mode(2, 380);
  42.   x_set_doublebuffer(260);
  43.   x_text_init();
  44.   _DMloadpal("dm256.pal");
  45.   load_boodle_icons();
  46.   animap mymap("boodle.map");
  47.   boodlepiece * myactor;
  48.   showlogo(&mymap);
  49.   allocate_forces(&mymap, boodlepoints, grumpoints);
  50.   char exit = 'd';
  51.   while (exit != 'Q')
  52.   {
  53.     turns++;
  54.     exit = boodleturn(&mymap);
  55.     if (exit == 0) break; //no living boodles
  56.     if (score > 3) break;
  57.     exit = grumturn(&mymap);
  58.     for (int width_counter = 0; width_counter < mymap.width; ++width_counter)
  59.       for (int height_counter = 0; height_counter < mymap.height; ++height_counter)
  60.     mymap.mapdata[width_counter][height_counter].my_terrain_type &= 0xEF;
  61.   }
  62.   endgame();
  63.   x_text_mode();
  64.   puts("Thank you for playing Flight of the Boodles!");
  65.   puts("\nLook for other upcoming releases:");
  66.   puts("Morningstar: Futuristic combat on a grand scale.  Mechs never had");
  67.   puts("         it so good...");
  68.   puts("Coverdale  : In 1994, shareware rpg's stop playing games.  Come back");
  69.   puts("         to the story... in Coverdale.\n");
  70.   puts("Flight of the Boodles was written with YakIcons1.2, the flexible object-");
  71.   puts("oriented icon programming library by V. Putz.  Available at fine FTP");
  72.   puts("sites everywhere.\n");
  73. }
  74.