Ignore:
Timestamp:
Dec 23, 2002, 4:06:13 PM (17 years ago)
Author:
Sam Hocevar
Message:
  • better handling of special weapon timeout.
  • the bomb is now part of the standard fire button effect.
  • overlay for life and special weapon jauges.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ttyvaders/trunk/src/common.h

    r60 r62  
    44 *                 All Rights Reserved
    55 *
    6  *   $Id: common.h,v 1.13 2002/12/23 13:46:27 sam Exp $
     6 *   $Id: common.h,v 1.14 2002/12/23 15:06:13 sam Exp $
    77 *
    88 *   This program is free software; you can redistribute it and/or modify
     
    2121 */
    2222
    23 #define MAX_LIFE 1000
    24 
     23/*
     24 * Compile-time limits
     25 */
    2526#define STARS 50
    2627#define WEAPONS 200
     
    2930#define EXPLOSIONS 200
    3031
     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 */
    3145#ifdef USE_SLANG
    3246#   include <slang.h>
     
    5064#define gfx_putcharTO(x,y,c) do{ gfx_goto(x,y); gfx_putchar(c); }while(0)
    5165
     66/*
     67 * Useful macros
     68 */
    5269#define GET_RAND(p,q) ((p)+(int)((1.0*((q)-(p)))*rand()/(RAND_MAX+1.0)))
    5370#define GET_MAX(a,b) ((a)>(b)?(a):(b))
    5471#define GET_MIN(a,b) ((a)<(b)?(a):(b))
    5572
     73/*
     74 * Game structures
     75 */
    5676typedef struct
    5777{
     
    106126    int x, y;
    107127    int vx, vy;
    108     int weapon, nuke;
     128    int weapon, special;
    109129    int life, dead;
    110130
     
    146166#define MAGENTA 10
    147167
    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 */
    152171void init_aliens( game *g, aliens *al );
    153172void draw_aliens( game *g, aliens *al );
     
    155174void add_alien( game *g, aliens *al, int x, int y, int type );
    156175
     176/*
     177 * From bonus.c
     178 */
     179void init_bonus( game *g, bonus *bo );
     180void draw_bonus( game *g, bonus *bo );
     181void update_bonus( game *g, bonus *bo );
     182void add_bonus( game *g, bonus *bo, int x, int y, int type );
     183
     184/*
     185 * From ceo.c
     186 */
     187void ceo_alert( void );
     188
     189/*
     190 * From collide.c
     191 */
     192void collide_weapons_tunnel( game *g, weapons *wp, tunnel *t, explosions *ex );
     193void collide_weapons_aliens( game *g, weapons *wp, aliens *al, explosions *ex );
     194void collide_player_tunnel( game *g, player *p, tunnel *t, explosions *ex );
     195
     196/*
     197 * From explosions.c
     198 */
     199void init_explosions( game *g, explosions *ex );
     200void add_explosion( game *g, explosions *ex, int x, int y, int vx, int vy, int type );
     201void draw_explosions( game *g, explosions *ex );
     202void update_explosions( game *g, explosions *ex );
     203
     204/*
     205 * From graphics.c
     206 */
    157207int init_graphics( void );
    158208void init_game( game *g );
     
    162212void end_graphics( void );
    163213
     214/*
     215 * From math.c
     216 */
     217int r00t( int a );
     218
     219/*
     220 * From overlay.c
     221 */
     222void draw_overlay( game *g );
     223
     224/*
     225 * From player.c
     226 */
    164227player * create_player( game *g );
    165228void free_player( player *p );
     
    167230void update_player( game *g, player *p );
    168231
     232/*
     233 * From starfield.c
     234 */
     235starfield * create_starfield( game *g );
     236void draw_starfield( game *g, starfield *s );
     237void update_starfield( game *g, starfield *s );
     238void free_starfield( game *g, starfield *s );
     239
     240/*
     241 * From tunnel.c
     242 */
     243tunnel * create_tunnel( game *g, int w, int h );
     244void free_tunnel( tunnel *t );
     245void draw_tunnel( game *g, tunnel *t );
     246void update_tunnel( game *g, tunnel *t );
     247
     248/*
     249 * From weapons.c
     250 */
    169251void init_weapons( game *g, weapons *wp );
    170252void draw_weapons( game *g, weapons *wp );
     
    172254void add_weapon( game *g, weapons *wp, int x, int y, int vx, int vy, int type );
    173255
    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.