- Timestamp:
- Dec 23, 2002, 5:21:38 PM (20 years ago)
- Location:
- ttyvaders/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
ttyvaders/trunk/configure.ac
r52 r64 1 1 dnl Autoconf settings for ttyvaders 2 2 3 AC_INIT(ttyvaders,0.0cvs-200212 18)3 AC_INIT(ttyvaders,0.0cvs-20021223) 4 4 5 5 AC_PREREQ(2.50) … … 8 8 AC_CANONICAL_SYSTEM 9 9 10 AM_INIT_AUTOMAKE(ttyvaders,0.0cvs-200212 18)10 AM_INIT_AUTOMAKE(ttyvaders,0.0cvs-20021223) 11 11 AM_CONFIG_HEADER(config.h) 12 12 -
ttyvaders/trunk/src/collide.c
r60 r64 4 4 * All Rights Reserved 5 5 * 6 * $Id: collide.c,v 1. 9 2002/12/23 13:46:27sam Exp $6 * $Id: collide.c,v 1.10 2002/12/23 16:21:38 sam Exp $ 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify … … 42 42 case WEAPON_BOMB: 43 43 case WEAPON_FRAGBOMB: 44 if( y < 0 || y >= g->h ) 45 { 46 break; 47 } 48 44 49 if( x <= t->left[y] 45 50 || x >= t->right[y] ) … … 51 56 if( x <= t->left[y] ) 52 57 { 53 t->right[y-2] -= damage - 1;54 t->left[y-1] -= damage;58 if( y-2 >= 0 ) t->right[y-2] -= damage - 1; 59 if( y-1 >= 0 ) t->left[y-1] -= damage; 55 60 t->left[y] -= damage + 1; 56 t->left[y+1] -= damage;57 t->right[y+2] -= damage - 1;61 if( y+1 < g->h ) t->left[y+1] -= damage; 62 if( y+2 < g->h ) t->right[y+2] -= damage - 1; 58 63 } 59 64 else 60 65 { 61 t->right[y-2] += damage - 1;62 t->right[y-1] += damage;66 if( y-2 >= 0 ) t->right[y-2] += damage - 1; 67 if( y-1 >= 0 ) t->right[y-1] += damage; 63 68 t->right[y] += damage + 1; 64 t->right[y+1] += damage;65 t->right[y+2] += damage - 1;69 if( y+1 < g->h ) t->right[y+1] += damage; 70 if( y+2 < g->h ) t->right[y+2] += damage - 1; 66 71 } 67 72 … … 81 86 j++ ) 82 87 { 88 if( y+j >= g->h || y+j < 0 ) 89 { 90 continue; 91 } 92 83 93 if( x <= t->left[y+j] || x >= t->right[y+j] ) 84 94 { … … 88 98 if( x <= t->left[y+j] ) 89 99 { 90 t->left[y+j-1]--; 100 if( y+j-1 >= 0 ) 101 { 102 t->left[y+j-1]--; 103 } 91 104 t->left[y+j] -= 2; 92 t->left[y+j+1]--; 105 if( y+j+1 < g->h ) 106 { 107 t->left[y+j+1]--; 108 } 93 109 } 94 110 else 95 111 { 96 t->right[y+j-1]++; 112 if( y+j-1 >= 0 ) 113 { 114 t->right[y+j-1]++; 115 } 97 116 t->right[y+j] += 2; 98 t->right[y+j+1]++; 117 if( y+j+1 < g->h ) 118 { 119 t->right[y+j+1]++; 120 } 99 121 } 100 122 break; … … 269 291 if( p->x <= t->left[p->y] ) 270 292 { 271 p->x += 2; 272 add_explosion( g, ex, p->x+1, p->y-2, 0, 0, EXPLOSION_SMALL ); 273 p->life -= 50; 293 p->x += 3; 294 p->vx = 2; 295 add_explosion( g, ex, p->x+1, p->y-1, 0, 0, EXPLOSION_SMALL ); 296 p->life -= 80; 274 297 } 275 298 else if( p->x + 5 >= t->right[p->y] ) 276 299 { 277 p->x -= 2; 278 add_explosion( g, ex, p->x+4, p->y-2, 0, 0, EXPLOSION_SMALL ); 279 p->life -= 50; 300 p->x -= 3; 301 p->vx = -2; 302 add_explosion( g, ex, p->x+4, p->y-1, 0, 0, EXPLOSION_SMALL ); 303 p->life -= 80; 280 304 } 281 305 } -
ttyvaders/trunk/src/common.h
r62 r64 4 4 * All Rights Reserved 5 5 * 6 * $Id: common.h,v 1.1 4 2002/12/23 15:06:13sam Exp $6 * $Id: common.h,v 1.15 2002/12/23 16:21:38 sam Exp $ 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify … … 56 56 # define gfx_putstr(x) addstr(x) 57 57 #else 58 # define gfx_color(x) do{}while(0)59 # define gfx_goto(x,y) do{ }while(0)60 # define gfx_putchar(x) do{}while(0)61 # define gfx_putstr(x) do{}while(0)58 # define gfx_color(x) (void)(x) 59 # define gfx_goto(x,y) do{ (void)(x); (void)(y); } while(0) 60 # define gfx_putchar(x) (void)(x) 61 # define gfx_putstr(x) (void)(x) 62 62 #endif 63 63 … … 208 208 void init_game( game *g ); 209 209 char get_key( void ); 210 void gfx_delay( void ); 210 211 void clear_graphics( void ); 211 212 void refresh_graphics( void ); -
ttyvaders/trunk/src/graphics.c
r52 r64 4 4 * All Rights Reserved 5 5 * 6 * $Id: graphics.c,v 1. 5 2002/12/23 10:06:27sam Exp $6 * $Id: graphics.c,v 1.6 2002/12/23 16:21:38 sam Exp $ 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify … … 21 21 */ 22 22 23 #include "config.h" 24 23 25 #include <stdlib.h> 26 #include <unistd.h> 24 27 25 28 #include "common.h" … … 122 125 #else 123 126 /* Use dummy driver */ 127 char key = GET_RAND(0,256); 128 129 if( key != 'q' && key != 'p' && key != '\t' ) 130 { 131 return key; 132 } 124 133 #endif 125 134 126 135 return 0; 136 } 137 138 void gfx_delay( void ) 139 { 140 #ifdef USE_SLANG 141 usleep(40000); 142 #elif USE_NCURSES 143 usleep(40000); 144 #else 145 /* Use dummy driver */ 146 #endif 127 147 } 128 148 -
ttyvaders/trunk/src/main.c
r62 r64 4 4 * All Rights Reserved 5 5 * 6 * $Id: main.c,v 1.1 5 2002/12/23 15:06:13sam Exp $6 * $Id: main.c,v 1.16 2002/12/23 16:21:38 sam Exp $ 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify … … 25 25 26 26 #include <string.h> 27 #include <unistd.h> 27 28 #include <time.h> 28 29 29 30 #include "common.h" … … 35 36 game *g = malloc(sizeof(game)); 36 37 37 //srand(time(NULL));38 srand(time(NULL)); 38 39 39 40 if( init_graphics() ) … … 165 166 } 166 167 167 usleep(40000);168 gfx_delay(); 168 169 169 170 if( !poz || skip ) … … 201 202 202 203 update_explosions( g, g->ex ); 203 /*if(purcompteur%2)*/update_tunnel( g, g->t );204 update_tunnel( g, g->t ); 204 205 } 205 206 -
ttyvaders/trunk/src/overlay.c
r62 r64 4 4 * All Rights Reserved 5 5 * 6 * $Id: overlay.c,v 1. 1 2002/12/23 15:06:13sam Exp $6 * $Id: overlay.c,v 1.2 2002/12/23 16:21:38 sam Exp $ 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify … … 32 32 /* Draw life jauge */ 33 33 gfx_color( GRAY ); 34 gfx_goto( 2, 1 );34 gfx_goto( 4, 1 ); 35 35 gfx_putstr( dots30 ); 36 36 … … 48 48 } 49 49 50 gfx_goto( 2, 1 );50 gfx_goto( 4, 1 ); 51 51 gfx_putstr( dashes30 + ( MAX_LIFE - g->p->life ) * 30 / MAX_LIFE ); 52 52 53 53 gfx_color( WHITE ); 54 54 gfx_goto( 1, 1 ); 55 gfx_putstr( "L |" ); 56 gfx_goto( 34, 1 ); 55 57 gfx_putstr( "|" ); 56 gfx_goto( 32, 1 );57 gfx_putstr( "| L" );58 58 59 59 /* Draw weapon jauge */ 60 60 gfx_color( GRAY ); 61 gfx_goto( 38, 1 );61 gfx_goto( 42, 1 ); 62 62 gfx_putstr( dots30 + 10 ); 63 63 … … 75 75 } 76 76 77 gfx_goto( 38, 1 );77 gfx_goto( 42, 1 ); 78 78 gfx_putstr( dashes30 + 10 + ( MAX_SPECIAL - g->p->special ) * 20 / MAX_SPECIAL ); 79 79 80 80 gfx_color( WHITE ); 81 gfx_goto( 37, 1 ); 81 gfx_goto( 39, 1 ); 82 gfx_putstr( "S |" ); 83 gfx_goto( 62, 1 ); 82 84 gfx_putstr( "|" ); 83 gfx_goto( 58, 1 );84 gfx_putstr( "| S" );85 85 } 86 86 -
ttyvaders/trunk/src/player.c
r62 r64 4 4 * All Rights Reserved 5 5 * 6 * $Id: player.c,v 1. 7 2002/12/23 15:06:13sam Exp $6 * $Id: player.c,v 1.8 2002/12/23 16:21:38 sam Exp $ 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify … … 37 37 p->special = MAX_SPECIAL; 38 38 p->life = MAX_LIFE; 39 p->dead = 0; 39 40 40 41 return p;
Note: See TracChangeset
for help on using the changeset viewer.