home *** CD-ROM | disk | FTP | other *** search
/ Game Programming - All in One (3rd Edition) / game_prog_all_in_one_3rd_ed.iso / sources / chapter15 / Warbirds / warbirds.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-09-15  |  1.5 KB  |  73 lines

  1. /////////////////////////////////////////////////////////
  2. // Game Programming All In One, Third Edition
  3. // Chapter 15 - Warbirds
  4. /////////////////////////////////////////////////////////
  5.  
  6. #ifndef _WARBIRDS_H
  7. #define _WARBIRDS_H
  8.  
  9. #include "allegro.h"
  10. #include "mappyal.h"
  11.  
  12. //this must run at 640x480
  13. //#define MODE GFX_AUTODETECT_FULLSCREEN
  14. #define MODE GFX_AUTODETECT_WINDOWED
  15. #define WIDTH 640
  16. #define HEIGHT 480
  17.  
  18. #define WHITE makecol(255,255,255)
  19. #define GRAY makecol(60,60,60)
  20. #define RED makecol(200,0,0)
  21.  
  22. #define MAX_ENEMIES 20
  23. #define MAX_BULLETS 20
  24. #define MAX_EXPLOSIONS 10
  25. #define BOTTOM 48000 - HEIGHT
  26.  
  27. //define the sprite structure
  28. typedef struct SPRITE
  29. {
  30.     int dir, alive;
  31.     int x,y;
  32.     int width,height;
  33.     int xspeed,yspeed;
  34.     int xdelay,ydelay;
  35.     int xcount,ycount;
  36.     int curframe,maxframe,animdir;
  37.     int framecount,framedelay;
  38. }SPRITE;
  39.  
  40. //y offset in pixels 
  41. int yoffset = BOTTOM;
  42.  
  43. //player variables
  44. int firecount = 0;
  45. int firedelay = 60;
  46. int health = 25;
  47. int score = 0;
  48.  
  49. //timer variables
  50. volatile int counter;
  51. volatile int ticks;
  52. volatile int framerate;
  53.  
  54. //bitmaps and sprites
  55. BITMAP *buffer;    
  56. BITMAP *temp;
  57. BITMAP *explosion_images[6];
  58. SPRITE *explosions[MAX_EXPLOSIONS];
  59. BITMAP *bigexp_images[7];
  60. SPRITE *bigexp;
  61. BITMAP *player_images[3];
  62. SPRITE *player;
  63. BITMAP *bullet_images[3];
  64. SPRITE *bullets[MAX_BULLETS];
  65. BITMAP *enemy_plane_images[3];
  66. SPRITE *enemy_planes[MAX_ENEMIES];
  67. BITMAP *progress, *bar;
  68. BITMAP *bonus_shot_image;
  69. SPRITE *bonus_shot;
  70.  
  71. #endif
  72.  
  73.