diff --git a/src/cacatris.h b/src/cacatris.h index 6259473..960eada 100644 --- a/src/cacatris.h +++ b/src/cacatris.h @@ -59,7 +59,7 @@ typedef struct piece_t_ { } piece_t; -void infos_populate(cucul_canvas_t *, unsigned int score, unsigned char level); +void infos_populate(cucul_canvas_t *, unsigned int, unsigned char , unsigned char); void playfield_draw(cucul_canvas_t *); void put_piece(unsigned int, unsigned int, unsigned int, unsigned int); void remove_piece(unsigned int id, unsigned int x, unsigned int y, unsigned int rot); diff --git a/src/main.c b/src/main.c index d9bbcea..5adf027 100644 --- a/src/main.c +++ b/src/main.c @@ -130,7 +130,7 @@ int main(int argc, char *argv[]) /* Populate info canvas */ - infos_populate(infos, score, level); + infos_populate(infos, score, level, total_lines); /* Draw everything on playfield */ put_piece(current_piece, x ,y, rotation); playfield_draw(field); @@ -165,7 +165,7 @@ int main(int argc, char *argv[]) { level++; total_lines = 0; - speed+=2; + speed+=4; memset(playfield, 0, FIELD_WIDTH*FIELD_HEIGHT); } } @@ -184,14 +184,17 @@ int main(int argc, char *argv[]) } -void infos_populate(cucul_canvas_t *inf, unsigned int score, unsigned char level) +void infos_populate(cucul_canvas_t *inf, unsigned int score, + unsigned char level, unsigned char total) { unsigned int i; - char scoreline[1024]; - char levelline[1024]; + char scoreline[256]; + char levelline[256]; + char totalline[256]; sprintf(scoreline, " Score : %05d ", score); sprintf(levelline, " Level : %02d ", level); + sprintf(totalline, " Lines : %02d ", total); cucul_set_color(inf, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE); cucul_putstr(inf, 0, 0, " =Cacatris= "); @@ -201,9 +204,10 @@ void infos_populate(cucul_canvas_t *inf, unsigned int score, unsigned char level cucul_putstr(inf, 0, 4, " "); cucul_putstr(inf, 0, 5, levelline); cucul_putstr(inf, 0, 6, scoreline); - cucul_putstr(inf, 0, 7, " Time : XX:XX "); + cucul_putstr(inf, 0, 7, totalline); + cucul_putstr(inf, 0, 8, " Time : XX:XX "); - for(i = 7; i < cucul_get_canvas_height(inf); i++) + for(i = 8; i < cucul_get_canvas_height(inf); i++) { cucul_putstr(inf, 0, i," "); }