home *** CD-ROM | disk | FTP | other *** search
/ Game Programming - All in One (3rd Edition) / game_prog_all_in_one_3rd_ed.iso / software / Mappy / mappyal / main.c < prev    next >
Encoding:
C/C++ Source or Header  |  2004-04-14  |  1.1 KB  |  50 lines

  1. /*
  2.  * MPGAME - A test game to demonstrate the MappyAL playback library
  3.  * By Robin Burrows <rburrows@bigfoot.com>
  4.  * Mappy available from:
  5.  * http://www.geocities.com/SiliconValley/Vista/7336/robcstf.htm
  6.  * http://www.rbsite.freeserve.co.uk/robcstf.htm
  7.  *
  8.  * Don't forget to check out Molefest and Alien Epidemic!
  9.  */
  10.  
  11. #include <stdio.h>
  12. #include <allegro.h>
  13. #include "mappyal.h"
  14.  
  15.  
  16. #define SWIDTH 320
  17. #define SHEIGHT 240
  18.  
  19. int playerx = 80;        /* X and Y offset of player in pixels */
  20. int playery = 700;        /* from top left of map */
  21. BITMAP * mapdisplaybuffer;    /* Memory bitmap for double buffer */
  22.  
  23. /* This is an extremely basic collision detection routine, a proper game would
  24.  * need a better one
  25.  */
  26. int Collision (int x, int y)
  27. {
  28. BLKSTR * blkdatapt;
  29.  
  30.     blkdatapt = MapGetBlock (x/mapblockwidth, y/mapblockheight);
  31.  
  32.     if (blkdatapt->tl) return 1; else return 0;
  33. }
  34.  
  35. /* This simply removes an object once it's collected */
  36. void ClearCell (int x, int y)
  37. {
  38.     MapSetBlock (x/mapblockwidth, y/mapblockheight, 0);
  39. }
  40.  
  41. int main (void)
  42. {
  43.  
  44.     return 0;
  45. }
  46. #ifdef END_OF_MAIN
  47. END_OF_MAIN()
  48. #endif
  49.  
  50.