Ignore:
Timestamp:
Dec 13, 2002, 8:27:16 PM (18 years ago)
Author:
Sam Hocevar
Message:
  • moved nuke from explosions to weapons.
  • used a cool Bresenham algorithm to draw the nuke circles.
  • nuke collides with aliens.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ttyvaders/trunk/common.h

    r12 r16  
    11
    22#define STARS 50
    3 #define SHOTS 50
     3#define WEAPONS 50
    44#define ROCKS 10
    55#define ALIENS 10
     
    1717#   define GFX_WRITE(x) addch(x)
    1818#endif
     19
     20#define GFX_WRITETO(x,y,c) do{ GFX_GOTO(x,y); GFX_WRITE(c); }while(0)
    1921
    2022#define GET_RAND(p,q) ((p)+(int)((1.0*((q)-(p)))*rand()/(RAND_MAX+1.0)))
     
    5557typedef struct
    5658{
    57     int x[SHOTS];
    58     int y[SHOTS];
    59     int v[SHOTS];
     59    int x[WEAPONS];
     60    int y[WEAPONS];
     61    int v[WEAPONS];
     62    int n[WEAPONS];
     63    int type[WEAPONS];
    6064
    6165} weapons;
     
    6569    int x, y;
    6670    int dir;
    67     int weapon;
     71    int weapon, nuke;
    6872
    6973} player;
     
    113117void draw_weapons( game *g, weapons *wp );
    114118void update_weapons( game *g, weapons *wp );
    115 void add_weapon( game *g, weapons *wp, int x, int y );
     119void add_weapon( game *g, weapons *wp, int x, int y, int type );
    116120
    117121void init_starfield( game *g, starfield *s );
Note: See TracChangeset for help on using the changeset viewer.