Changeset 60 for ttyvaders/trunk/src/player.c
- Timestamp:
- Dec 23, 2002, 2:46:27 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ttyvaders/trunk/src/player.c
r58 r60 4 4 * All Rights Reserved 5 5 * 6 * $Id: player.c,v 1. 5 2002/12/23 13:13:04sam Exp $6 * $Id: player.c,v 1.6 2002/12/23 13:46:27 sam Exp $ 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify … … 36 36 p->weapon = 0; 37 37 p->nuke = 0; 38 p->life = MAX_LIFE; 38 39 39 40 return p; … … 47 48 void draw_player( game *g, player *p ) 48 49 { 50 if( p->dead ) 51 { 52 return; 53 } 54 49 55 gfx_goto( p->x + 2, p->y - 2 ); 50 56 gfx_color( GREEN ); … … 63 69 void update_player( game *g, player *p ) 64 70 { 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 */ 65 84 if( p->weapon ) 66 85 { … … 73 92 } 74 93 94 /* Update life */ 95 if( p->life < MAX_LIFE ) 96 { 97 p->life++; 98 } 99 100 /* Update coords */ 75 101 p->x += p->vx; 76 102
Note: See TracChangeset
for help on using the changeset viewer.