Commit 550dd390 authored by Ivo Júnior's avatar Ivo Júnior
Browse files

Adicionado dois pontos e comeco de um menu funcional

parent a66b3339
1000 1000 1000
0 0 0
0 0 1000
000000000000000000000000000000000000000
011111111111111111111111111111111111110
012222222222222222222222222222222222210
012111122111121222211122211112111222210
012122212122121222212212212222122122210
012122212122121222212221211122121222210
012122122122121222212221211122112222210
012122212122121222212212212222121222210
012111122111121111211122211112122122210
012222222222222222222222222222222222210
012222222222211122222122211111212221210
012222222222212212221212212222212221210
012222222222212221212221211111211111210
012222222222212221211111222221211111210
012222222222212212212221222221212221210
012222222222211122212221211111212221210
012222222222222222222222222222222222210
011111111111111111111111111111111111110
000000000000000000000000000000000000000
00000000high0score:00000000000000000000
00000000last000000:00000000000000000000
0000<0>00000000cave00000000000000000000
000000000000000000000000000000000enter0
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!@
@!###################################!@
@!#!!!!##!!!!#!####!!!###!!!!#!!!####!@
@!#!###!#!##!#!####!##!##!####!##!###!@
@!#!###!#!##!#!####!###!#!!!##!#!####!@
@!#!##!##!##!#!####!###!#!!!##!!#####!@
@!#!###!#!##!#!####!##!##!####!#!####!@
@!#!!!!##!!!!#!!!!#!!!###!!!!#!##!###!@
@!###################################!@
@!###########!!!#####!###!!!!!#!###!#!@
@!###########!##!###!#!##!#####!###!#!@
@!###########!###!#!###!#!!!!!#!!!!!#!@
@!###########!###!#!!!!!#####!#!!!!!#!@
@!###########!##!##!###!#####!#!###!#!@
@!###########!!!###!###!#!!!!!#!###!#!@
@!###################################!@
@!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@high@score:@@@@@@@@@@@@@@@@@@@@
@@@@@@@@last@@@@@@:@@@@@@@@@@@@@@@@@@@@
@@@@<@>@@@@@@@@cave@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@enter@
......@@ -4,6 +4,8 @@ int menuColors[3][3];
char input[WIDTH];
int offmenuy, offmenux;
int row, col;
char mps[5] = {'a', 'b', 'c', 'd', 'e'};
int currmap = 0;
void readFileMenu(menu *menu) {
int i, j;
......@@ -45,23 +47,52 @@ void setMenuColors() {
}
int updateMenu(menu *menu, int action) {
return 0;
switch(action){
case 6:
currmap = (currmap + 1) % 5;
menu->grid[21][21] = mps[currlevel];
break;
case 4:
currmap = (currmap - 1) % 5;
menu->grid[21][21] = mps[currmap];
break;
default:
menu->grid[21][21] = mps[currmap];
break;
}
}
void renderMenu(menu *menu){
int i, j, k, l;
mvprintw(0, 0, "%c", 'a');
menu->grid[21][21] = 'a';
/*menu->grid[21][19] = ((player.score / 100000) % 10);
menu->grid[22][19] = ((player.score / 10000) % 10);
menu->grid[23][19] = ((player.score / 1000) % 10);
menu->grid[24][19] = ((player.score / 100) % 10);
menu->grid[25][19] = ((player.score / 10) % 10);
menu->grid[26][19] = (player.score % 10);
menu->grid[21][20] = ((player.score / 100000) % 10);
menu->grid[22][20] = ((player.score / 10000) % 10);
menu->grid[23][20] = ((player.score / 1000) % 10);
menu->grid[24][20] = ((player.score / 100) % 10);
menu->grid[25][20] = ((player.score / 10) % 10);
menu->grid[26][20] = (player.score % 10);*/
for (i = 0; i < WIDTH; i++) {
for (j = 0; j < HEIGHT; j++) {
switch (menu->grid[i][j]) {
case('0'):
case('@'):
attron(COLOR_PAIR(1));
for (k = 0; k < 3; k++)
for (l = 0; l < 6; l++)
mvprintw(3*j+k+offmenuy, 6*i+l+offmenux, "%c", ' ');
attroff(COLOR_PAIR(1));
break;
case('1'):
case('!'):
attron(COLOR_PAIR(4));
for (k = 0; k < 3; k++)
for (l = 0; l < 6; l++)
......@@ -69,7 +100,7 @@ void renderMenu(menu *menu){
attroff(COLOR_PAIR(4));
break;
case('2'):
case('#'):
attron(COLOR_PAIR(3));
for (k = 0; k < 3; k++)
for (l = 0; l < 6; l++)
......@@ -103,6 +134,12 @@ void renderMenu(menu *menu){
case('a'):
renderChar(A, i, j, offmenux, offmenuy, 2);
break;
case('b'):
renderChar(B, i, j, offmenux, offmenuy, 2);
break;
case('d'):
renderChar(D, i, j, offmenux, offmenuy, 2);
break;
case('t'):
renderChar(T, i, j, offmenux, offmenuy, 2);
break;
......@@ -120,6 +157,39 @@ void renderMenu(menu *menu){
break;
case('n'):
renderChar(N, i, j, offmenux, offmenuy, 2);
break;
case(':'):
renderChar(DOTS, i, j, offmenux, offmenuy, 2);
break;
case('1'):
renderChar(one, i, j, offmenux, offmenuy, 2);
break;
case('2'):
renderChar(two, i, j, offmenux, offmenuy, 2);
break;
case('3'):
renderChar(three, i, j, offmenux, offmenuy, 2);
break;
case('4'):
renderChar(four, i, j, offmenux, offmenuy, 2);
break;
case('5'):
renderChar(five, i, j, offmenux, offmenuy, 2);
break;
case('6'):
renderChar(six, i, j, offmenux, offmenuy, 2);
break;
case('7'):
renderChar(seven, i, j, offmenux, offmenuy, 2);
break;
case('8'):
renderChar(eight, i, j, offmenux, offmenuy, 2);
break;
case('9'):
renderChar(nine, i, j, offmenux, offmenuy, 2);
break;
case('0'):
renderChar(zero, i, j, offmenux, offmenuy, 2);
break;
}
}
......
......@@ -27,6 +27,7 @@ char T[3][6] = {" ___ ", " | ", " | "};
char V[3][6] = {" ", " \\ / ", " \\/ "};
char SL[3][6] = {" ", " /___ ", " \\ "};
char SR[3][6] = {" ", " ___\\ ", " / "};
char DOTS[3][6] = {" ", " . ", " . "};
void renderChar(char mat[3][6], int i, int j, int offx, int offy, int color) {
......
......@@ -40,6 +40,7 @@ char T[3][6];
char V[3][6];
char SL[3][6];
char SR[3][6];
char DOTS[3][6];
void renderChar(char mat[3][6], int i, int j, int offx, int offy, int color);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment