Ignore:
Timestamp:
Dec 23, 2002, 2:46:27 PM (17 years ago)
Author:
Sam Hocevar
Message:
  • aliens are now named foo, bar and baz.
  • beginning of life jauges.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ttyvaders/trunk/src/player.c

    r58 r60  
    44 *                 All Rights Reserved
    55 *
    6  *   $Id: player.c,v 1.5 2002/12/23 13:13:04 sam Exp $
     6 *   $Id: player.c,v 1.6 2002/12/23 13:46:27 sam Exp $
    77 *
    88 *   This program is free software; you can redistribute it and/or modify
     
    3636    p->weapon = 0;
    3737    p->nuke = 0;
     38    p->life = MAX_LIFE;
    3839
    3940    return p;
     
    4748void draw_player( game *g, player *p )
    4849{
     50    if( p->dead )
     51    {
     52        return;
     53    }
     54
    4955    gfx_goto( p->x + 2, p->y - 2 );
    5056    gfx_color( GREEN );
     
    6369void update_player( game *g, player *p )
    6470{
     71    if( p->dead )
     72    {
     73        return;
     74    }
     75
     76    if( p->life <= 0 )
     77    {
     78        add_explosion( g, g->ex, p->x, p->y, 0, 0, EXPLOSION_SMALL );
     79        p->dead = 1;
     80        return;
     81    }
     82
     83    /* Update weapon stats */
    6584    if( p->weapon )
    6685    {
     
    7392    }
    7493
     94    /* Update life */
     95    if( p->life < MAX_LIFE )
     96    {
     97        p->life++;
     98    }
     99
     100    /* Update coords */
    75101    p->x += p->vx;
    76102
Note: See TracChangeset for help on using the changeset viewer.