|
|
@@ -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," "); |
|
|
|
} |
|
|
|