Changeset 88 for ttyvaders/trunk/src/bonus.c
 Timestamp:
 Nov 9, 2003, 2:16:19 PM (17 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

ttyvaders/trunk/src/bonus.c
r80 r88 25 25 #include "common.h" 26 26 27 void init_bonus( game *g, bonus *bo)27 void init_bonus(game *g, bonus *bo) 28 28 { 29 29 int i; 30 30 31 for( i = 0; i < BONUS; i++)31 for(i = 0; i < BONUS; i++) 32 32 { 33 33 bo>type[i] = BONUS_NONE; … … 35 35 } 36 36 37 void draw_bonus( game *g, bonus *bo)37 void draw_bonus(game *g, bonus *bo) 38 38 { 39 39 int i; 40 40 41 for( i = 0; i < BONUS; i++)41 for(i = 0; i < BONUS; i++) 42 42 { 43 switch( bo>type[i])43 switch(bo>type[i]) 44 44 { 45 45 case BONUS_GREEN: 46 ee_color( (bo>n[i]/2 % 3) ? EE_GREEN : EE_WHITE);47 ee_goto( bo>x[i]+1, bo>y[i]1);48 ee_putchar( '_');49 ee_goto( bo>x[i], bo>y[i]);50 ee_putstr( "/ \\");51 ee_goto( bo>x[i], bo>y[i]+1);52 ee_putstr( "\\_/");53 ee_color( EE_WHITE);54 ee_goto( bo>x[i]+1, bo>y[i]);55 ee_putchar( 'g');46 ee_color((bo>n[i]/2 % 3) ? EE_GREEN : EE_WHITE); 47 ee_goto(bo>x[i]+1, bo>y[i]1); 48 ee_putchar('_'); 49 ee_goto(bo>x[i], bo>y[i]); 50 ee_putstr("/ \\"); 51 ee_goto(bo>x[i], bo>y[i]+1); 52 ee_putstr("\\_/"); 53 ee_color(EE_WHITE); 54 ee_goto(bo>x[i]+1, bo>y[i]); 55 ee_putchar('g'); 56 56 break; 57 57 case BONUS_LIFE: 58 ee_color( (bo>n[i] % 3) ? EE_RED : EE_WHITE);59 ee_goto( bo>x[i]+1, bo>y[i]1);60 ee_putchar( '_');61 ee_goto( bo>x[i]+3, bo>y[i]1);62 ee_putchar( '_');63 ee_goto( bo>x[i], bo>y[i]);64 ee_putstr( "( ' )");65 ee_goto( bo>x[i]+1, bo>y[i]+1);66 ee_putstr( "`v'");67 ee_color( EE_WHITE);68 ee_goto( bo>x[i]+3, bo>y[i]);69 ee_putchar( '^');58 ee_color((bo>n[i] % 3) ? EE_RED : EE_WHITE); 59 ee_goto(bo>x[i]+1, bo>y[i]1); 60 ee_putchar('_'); 61 ee_goto(bo>x[i]+3, bo>y[i]1); 62 ee_putchar('_'); 63 ee_goto(bo>x[i], bo>y[i]); 64 ee_putstr("( ' )"); 65 ee_goto(bo>x[i]+1, bo>y[i]+1); 66 ee_putstr("`v'"); 67 ee_color(EE_WHITE); 68 ee_goto(bo>x[i]+3, bo>y[i]); 69 ee_putchar('^'); 70 70 break; 71 71 case BONUS_NONE: … … 75 75 } 76 76 77 void update_bonus( game *g, bonus *bo)77 void update_bonus(game *g, bonus *bo) 78 78 { 79 79 int i; 80 80 81 for( i = 0; i < BONUS; i++)81 for(i = 0; i < BONUS; i++) 82 82 { 83 switch( bo>type[i])83 switch(bo>type[i]) 84 84 { 85 85 case BONUS_GREEN: 86 86 bo>n[i]++; 87 87 bo>y[i]++; 88 if( bo>y[i] > g>h)88 if(bo>y[i] > g>h) 89 89 { 90 90 bo>type[i] = BONUS_NONE; … … 94 94 bo>n[i]++; 95 95 bo>y[i]++; 96 if( bo>y[i] > g>h)96 if(bo>y[i] > g>h) 97 97 { 98 98 bo>type[i] = BONUS_NONE; … … 105 105 } 106 106 107 void add_bonus( game *g, bonus *bo, int x, int y, int type)107 void add_bonus(game *g, bonus *bo, int x, int y, int type) 108 108 { 109 109 int i; 110 110 111 for( i = 0; i < BONUS; i++)111 for(i = 0; i < BONUS; i++) 112 112 { 113 if( bo>type[i] == BONUS_NONE)113 if(bo>type[i] == BONUS_NONE) 114 114 { 115 115 bo>type[i] = type;
Note: See TracChangeset
for help on using the changeset viewer.