Changeset 62 for ttyvaders/trunk/src/common.h
- Timestamp:
- Dec 23, 2002, 4:06:13 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ttyvaders/trunk/src/common.h
r60 r62 4 4 * All Rights Reserved 5 5 * 6 * $Id: common.h,v 1.1 3 2002/12/23 13:46:27sam Exp $6 * $Id: common.h,v 1.14 2002/12/23 15:06:13 sam Exp $ 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify … … 21 21 */ 22 22 23 #define MAX_LIFE 1000 24 23 /* 24 * Compile-time limits 25 */ 25 26 #define STARS 50 26 27 #define WEAPONS 200 … … 29 30 #define EXPLOSIONS 200 30 31 32 /* 33 * Game defines 34 */ 35 #define MAX_LIFE 1000 36 #define MAX_SPECIAL 200 37 38 #define COST_NUKE (100*MAX_SPECIAL/100) 39 #define COST_BEAM (75*MAX_SPECIAL/100) 40 #define COST_FRAGBOMB (50*MAX_SPECIAL/100) 41 42 /* 43 * Graphics primitives 44 */ 31 45 #ifdef USE_SLANG 32 46 # include <slang.h> … … 50 64 #define gfx_putcharTO(x,y,c) do{ gfx_goto(x,y); gfx_putchar(c); }while(0) 51 65 66 /* 67 * Useful macros 68 */ 52 69 #define GET_RAND(p,q) ((p)+(int)((1.0*((q)-(p)))*rand()/(RAND_MAX+1.0))) 53 70 #define GET_MAX(a,b) ((a)>(b)?(a):(b)) 54 71 #define GET_MIN(a,b) ((a)<(b)?(a):(b)) 55 72 73 /* 74 * Game structures 75 */ 56 76 typedef struct 57 77 { … … 106 126 int x, y; 107 127 int vx, vy; 108 int weapon, nuke;128 int weapon, special; 109 129 int life, dead; 110 130 … … 146 166 #define MAGENTA 10 147 167 148 void collide_weapons_tunnel( game *g, weapons *wp, tunnel *t, explosions *ex ); 149 void collide_weapons_aliens( game *g, weapons *wp, aliens *al, explosions *ex ); 150 void collide_player_tunnel( game *g, player *p, tunnel *t, explosions *ex ); 151 168 /* 169 * From aliens.c 170 */ 152 171 void init_aliens( game *g, aliens *al ); 153 172 void draw_aliens( game *g, aliens *al ); … … 155 174 void add_alien( game *g, aliens *al, int x, int y, int type ); 156 175 176 /* 177 * From bonus.c 178 */ 179 void init_bonus( game *g, bonus *bo ); 180 void draw_bonus( game *g, bonus *bo ); 181 void update_bonus( game *g, bonus *bo ); 182 void add_bonus( game *g, bonus *bo, int x, int y, int type ); 183 184 /* 185 * From ceo.c 186 */ 187 void ceo_alert( void ); 188 189 /* 190 * From collide.c 191 */ 192 void collide_weapons_tunnel( game *g, weapons *wp, tunnel *t, explosions *ex ); 193 void collide_weapons_aliens( game *g, weapons *wp, aliens *al, explosions *ex ); 194 void collide_player_tunnel( game *g, player *p, tunnel *t, explosions *ex ); 195 196 /* 197 * From explosions.c 198 */ 199 void init_explosions( game *g, explosions *ex ); 200 void add_explosion( game *g, explosions *ex, int x, int y, int vx, int vy, int type ); 201 void draw_explosions( game *g, explosions *ex ); 202 void update_explosions( game *g, explosions *ex ); 203 204 /* 205 * From graphics.c 206 */ 157 207 int init_graphics( void ); 158 208 void init_game( game *g ); … … 162 212 void end_graphics( void ); 163 213 214 /* 215 * From math.c 216 */ 217 int r00t( int a ); 218 219 /* 220 * From overlay.c 221 */ 222 void draw_overlay( game *g ); 223 224 /* 225 * From player.c 226 */ 164 227 player * create_player( game *g ); 165 228 void free_player( player *p ); … … 167 230 void update_player( game *g, player *p ); 168 231 232 /* 233 * From starfield.c 234 */ 235 starfield * create_starfield( game *g ); 236 void draw_starfield( game *g, starfield *s ); 237 void update_starfield( game *g, starfield *s ); 238 void free_starfield( game *g, starfield *s ); 239 240 /* 241 * From tunnel.c 242 */ 243 tunnel * create_tunnel( game *g, int w, int h ); 244 void free_tunnel( tunnel *t ); 245 void draw_tunnel( game *g, tunnel *t ); 246 void update_tunnel( game *g, tunnel *t ); 247 248 /* 249 * From weapons.c 250 */ 169 251 void init_weapons( game *g, weapons *wp ); 170 252 void draw_weapons( game *g, weapons *wp ); … … 172 254 void add_weapon( game *g, weapons *wp, int x, int y, int vx, int vy, int type ); 173 255 174 void init_bonus( game *g, bonus *bo );175 void draw_bonus( game *g, bonus *bo );176 void update_bonus( game *g, bonus *bo );177 void add_bonus( game *g, bonus *bo, int x, int y, int type );178 179 starfield * create_starfield( game *g );180 void draw_starfield( game *g, starfield *s );181 void update_starfield( game *g, starfield *s );182 void free_starfield( game *g, starfield *s );183 184 tunnel * create_tunnel( game *g, int w, int h );185 void free_tunnel( tunnel *t );186 void draw_tunnel( game *g, tunnel *t );187 void update_tunnel( game *g, tunnel *t );188 189 void init_explosions( game *g, explosions *ex );190 void add_explosion( game *g, explosions *ex, int x, int y, int vx, int vy, int type );191 void draw_explosions( game *g, explosions *ex );192 void update_explosions( game *g, explosions *ex );193 194 void ceo_alert( void );195 196 int r00t( int a );197
Note: See TracChangeset
for help on using the changeset viewer.