Main Page | Class List | Directories | File List | Class Members | File Members

supercsbros.h

Go to the documentation of this file.
00001 #ifndef _SUPERCSBROS_H
00002 #define _SUPERCSBROS_H
00003 #include "allegro.h"
00004 #include "mappyal.h"
00005 
00006 #define MODE   GFX_AUTODETECT_WINDOWED
00007 #define WIDTH  800
00008 #define HEIGHT 600
00009 
00010 #define WHITE makecol(255,255,255)
00011 #define GRAY  makecol(60,60,60)
00012 #define RED   makecol(200,0,0)
00013 
00014 #define MAX_ENEMIES 10
00015 #define MAX_BULLETS 1
00016 #define JUMPIT      1600
00017 
00018 #define PAN    128
00019 #define PITCH  1000
00020 #define VOLUME 128
00021 #define NUM_SOUNDS 5
00022 #define JUMP  0
00023 #define ITEM  1
00024 #define SHOOT 2
00025 #define HIT   3
00026 #define villian_Audio 4
00027 SAMPLE *sounds[NUM_SOUNDS];
00028 
00029 
00030 typedef struct ENVIRONMENT
00031 {
00032   unsigned char music_on; 
00033   int audio_pan;          /* non-orthoganal audio controls - if we mix sound effects w/music, */
00034   int audio_pitch;        /* turning down the volume affects the entire mix equally           */
00035   int audio_volume;
00036   int audio_enabled;
00037   char difficulty_level;
00038   float diff_mod;
00039   volatile int counter;
00040   volatile int ticks;
00041 } ENVIRONMENT;
00042 
00043 typedef struct SPRITE
00044 {
00045   int dir, alive;
00046   int x, y;
00047   int oldpx, oldpy;
00048   int width, height;
00049   int xspeed, yspeed;
00050   int xdelay, ydelay;
00051   int xcount, ycount;
00052   int curframe, maxframe, animdir, rightfacing;
00053   int framecount, framedelay;
00054   int collision;
00055 }SPRITE;
00056 
00057 typedef struct STATS
00058 {
00059   int score;    /* scores <= 1.2 * difficulty level */;
00060   int health;
00061   int lives;
00062 }STATS;
00063 
00064 char *player_bitmap = "players/stevieanim.bmp";
00065 char *enemy_bitmap1 = "players/misgreenanim.bmp";
00066 char *boss_bitmap   = "players/burrisanim.bmp";
00067 char *title_string  = "Super CS Brothers";
00068 char *cd_bitmap     = "objects/cd.bmp";
00069 char *jumpdrive_bitmap = "objects/jump.bmp";
00070 char *lava_bitmap   = "objects/fire.bmp";
00071 char *preend_bitmap = "images/preend.bmp";
00072 char *end_bitmap    = "images/end.bmp";
00073 
00074 char *bg_file = "images/background.bmp";
00075 char *map_file = "maps/level4.fmp";
00076 //char *map_file = "maps/50-50-test.fmp";
00077 
00078  
00079 char *jump_file   = "audio/jump.wav";
00080 char *item_file   = "audio/item.wav";
00081 char *shoot_file  = "audio/shoot.wav";
00082 char *hit_file    = "audio/hit.wav";
00083 
00084 SAMPLE *music;
00085 SAMPLE *jump_sound;
00086 SAMPLE *item_sound;
00087 SAMPLE *shoot_sound;
00088 SAMPLE *hit_sound;
00089 
00090 int jump = JUMPIT;
00091 int mapxoff, mapyoff;
00092 
00093 
00094 volatile int counter; 
00095 volatile int ticks;
00096 
00097 int buttons;
00098 
00099 
00100 BITMAP *buffer; 
00101 BITMAP *temp;
00102 BITMAP *progress_player, *bar;
00103 BITMAP *progress_boss, *bar;
00104 BITMAP *player_images[8];
00105 BITMAP *mis_1_images[8];
00106 BITMAP *boss_images[8];
00107 BITMAP *bullet_image;
00108 BITMAP *cd_image;
00109 BITMAP *jumpdrive_image;
00110 BITMAP *lava_images[3];
00111 BITMAP *preend_image;
00112 BITMAP *end_image;
00113 
00114 SPRITE *player;
00115 SPRITE *enemies[MAX_ENEMIES];
00116 SPRITE *boss;
00117 SPRITE *bullets[MAX_BULLETS];
00118 
00119 SPRITE *cd[5];
00120 SPRITE *jumpdrive[5];
00121 
00122 STATS  *stats;
00123 STATS  *bstats;
00124 ENVIRONMENT *env;
00125 
00126 /* Function prototypes */
00127 BITMAP *grabframe();
00128 void init_win32();
00129 void init_freebsd();
00130 void init_linux();
00131 void init_unix();
00132 void init_unknown();
00133 void updateplayer();
00134 void checkinput();
00135 void ticker();
00136 void updatestats();
00137 void updatebossstats();
00138 void restart_level();
00139 void show_splash();
00140 void loadsounds();
00141 void initialize();
00142 void main_menu();
00143 void quitgame();
00144 void settings_menu();
00145 void updatetime();
00146 void updatescore();
00147 void loadsprites();
00148 void draw_crosshair();
00149 void do_jump();
00150 char *OSinit(int number);
00151 void update_enemies();
00152 void fire();
00153 void updatesprite(SPRITE *spr);
00154 void updatebullets();
00155 void updatebullet(SPRITE *spr);
00156 void boss_battle();
00157 void StartAudio();
00158 void updateitems();
00159 void check_ground();
00160 void end_game();
00161 #endif

Generated on Wed Jul 5 09:05:19 2006 for Super CS Brothers by  doxygen 1.4.4