Commit 840faf64 authored by Ivo Júnior's avatar Ivo Júnior
Browse files

Consertado queda de diamantes.

parent 43c35690
586
\ No newline at end of file
687
\ No newline at end of file
564
15
\ No newline at end of file
......@@ -322,11 +322,11 @@ void renderMap(map *m, int time) {
}
break;
case('6'):
if (m->grid[i][j+1] == '0')
if (m->grid[i][j+1] == '0' || m->grid[i][j+1] == '7')
m->grid[i][j] = 'f';
if ((m->grid[i][j+1] == '6' || m->grid[i][j+1] == 'w' || m->grid[i][j+1] == 'z') && m->grid[i+1][j] == '0' && m->grid[i+1][j+1] == '0')
if ((m->grid[i][j+1] == '6' || m->grid[i][j+1] == 'w' || m->grid[i][j+1] == 'z' || m->grid[i][j+1] == '7') && m->grid[i+1][j] == '0' && m->grid[i+1][j+1] == '0')
m->grid[i][j] = 'r';
if ((m->grid[i][j+1] == '6' || m->grid[i][j+1] == 'w' || m->grid[i][j+1] == 'z') && m->grid[i-1][j] == '0' && m->grid[i-1][j+1] == '0')
if ((m->grid[i][j+1] == '6' || m->grid[i][j+1] == 'w' || m->grid[i][j+1] == 'z' || m->grid[i][j+1] == '7') && m->grid[i-1][j] == '0' && m->grid[i-1][j+1] == '0')
m->grid[i][j] = 'l';
for (k = 0; k < 3; k++)
......@@ -344,8 +344,12 @@ void renderMap(map *m, int time) {
}
break;
case('7'):
if (m->grid[i][j+1] == '0')
m->grid[i][j] = 'h';
if (m->grid[i][j+1] == '0' || m->grid[i][j+1] == '7')
m->grid[i][j] = 'F';
if ((m->grid[i][j+1] == '6' || m->grid[i][j+1] == 'w' || m->grid[i][j+1] == 'z' || m->grid[i][j+1] == '7') && m->grid[i+1][j] == '0' && m->grid[i+1][j+1] == '0')
m->grid[i][j] = 'R';
if ((m->grid[i][j+1] == '6' || m->grid[i][j+1] == 'w' || m->grid[i][j+1] == 'z' || m->grid[i][j+1] == '7') && m->grid[i-1][j] == '0' && m->grid[i-1][j+1] == '0')
m->grid[i][j] = 'L';
attron(COLOR_PAIR(7));
for (k = 0; k < 3; k++)
for (l = 0; l < 6; l++)
......@@ -386,7 +390,7 @@ void renderMap(map *m, int time) {
m->grid[i][j] = '6';
}
break;
case('h'):
case('F'):
attron(COLOR_PAIR(7));
for (k = 0; k < 3; k++)
for (l = 0; l < 6; l++)
......@@ -400,10 +404,10 @@ void renderMap(map *m, int time) {
if (waittime == 6) {
if (m->grid[i][j+1] == '0') {
m->grid[i][j+1] = 'h';
m->grid[i][j+1] = 'F';
m->grid[i][j] = '0';
} else if (m->grid[i][j+1] == '5') {
m->grid[i][j+1] = 'h';
m->grid[i][j+1] = 'F';
m->grid[i][j] = '0';
dead = true;
} else
......@@ -450,18 +454,58 @@ void renderMap(map *m, int time) {
if (!((k == 0 || k == 2) && (l == 0 || l == 5))) {
if (k == 0 && (l == 3 || l == 4)) {
attron(COLOR_PAIR(8));
mvprintw(3*j+k+offy, 6*i+l+offx, "%c", bould[k][l]);
mvprintw(3*j+k+offy, 6*i+l+offx, "%c", diamond[k][l]);
attroff(COLOR_PAIR(8));
} else {
attron(COLOR_PAIR(3));
mvprintw(3*j+k+offy, 6*i+l+offx, "%c", bould[k][l]);
mvprintw(3*j+k+offy, 6*i+l+offx, "%c", diamond[k][l]);
attroff(COLOR_PAIR(3));
}
}
}
case('R'):
for (k = 0; k < 3; k++)
for (l = 0; l < 6; l++) {
if (!((k == 0 || k == 2) && (l == 0 || l == 5))) {
attron(COLOR_PAIR(7));
for (k = 0; k < 3; k++)
for (l = 0; l < 6; l++)
if (time < 10)
mvprintw(3*j+k+offy, 6*i+l+offx, "%c", diamond[k][l]);
else if (time < 20)
mvprintw(3*j+k+offy, 6*i+l+offx, "%c", diamond2[k][l]);
else
mvprintw(3*j+k+offy, 6*i+l+offx, "%c", diamond3[k][l]);
attroff(COLOR_PAIR(7));
}
}
}
if (waittime == 6) {
if (m->grid[i+1][j] == '0') {
m->grid[i+1][j] = 'F';
m->grid[i][j] = '0';
}
}
break;
case('L'):
for (k = 0; k < 3; k++)
for (l = 0; l < 6; l++) {
if (!((k == 0 || k == 2) && (l == 0 || l == 5))) {
attron(COLOR_PAIR(7));
for (k = 0; k < 3; k++)
for (l = 0; l < 6; l++)
if (time < 10)
mvprintw(3*j+k+offy, 6*i+l+offx, "%c", diamond[k][l]);
else if (time < 20)
mvprintw(3*j+k+offy, 6*i+l+offx, "%c", diamond2[k][l]);
else
mvprintw(3*j+k+offy, 6*i+l+offx, "%c", diamond3[k][l]);
attroff(COLOR_PAIR(7));
}
}
if (waittime == 6) {
if (m->grid[i-1][j] == '0') {
m->grid[i-1][j] = 'f';
m->grid[i-1][j] = 'F';
m->grid[i][j] = '0';
}
}
......
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