Commit 1b731de0 authored by Bruno Freitas Tissei's avatar Bruno Freitas Tissei
Browse files

Fix merge

parents 5f722196 108e1d6c
......@@ -142,25 +142,43 @@ void updateMap(map *m, int action) {
} else {
waittime++;
if (waittime < 21) {
m->grid[player.y-1][player.x-1] = 'x';
m->grid[player.y][player.x-1] = 'x';
m->grid[player.y+1][player.x-1] = 'x';
m->grid[player.y-1][player.x] = 'x';
m->grid[player.y][player.x] = 'x';
m->grid[player.y+1][player.x] = 'x';
m->grid[player.y-1][player.x+1] = 'x';
m->grid[player.y][player.x+1] = 'x';
m->grid[player.y+1][player.x+1] = 'x';
if(m->grid[player.y-1][player.x-1] != '1')
m->grid[player.y-1][player.x-1] = 'x';
if(m->grid[player.y][player.x-1] != '1')
m->grid[player.y][player.x-1] = 'x';
if(m->grid[player.y+1][player.x-1] != '1')
m->grid[player.y+1][player.x-1] = 'x';
if(m->grid[player.y-1][player.x] != '1')
m->grid[player.y-1][player.x] = 'x';
if(m->grid[player.y][player.x] != '1')
m->grid[player.y][player.x] = 'x';
if(m->grid[player.y+1][player.x] != '1')
m->grid[player.y+1][player.x] = 'x';
if(m->grid[player.y-1][player.x+1] != '1')
m->grid[player.y-1][player.x+1] = 'x';
if(m->grid[player.y][player.x+1] != '1')
m->grid[player.y][player.x+1] = 'x';
if(m->grid[player.y+1][player.x+1] != '1')
m->grid[player.y+1][player.x+1] = 'x';
} else if (waittime <= 100) {
m->grid[player.y-1][player.x-1] = '0';
m->grid[player.y][player.x-1] = '0';
m->grid[player.y+1][player.x-1] = '0';
m->grid[player.y-1][player.x] = '0';
m->grid[player.y][player.x] = '0';
m->grid[player.y+1][player.x] = '0';
m->grid[player.y-1][player.x+1] = '0';
m->grid[player.y][player.x+1] = '0';
m->grid[player.y+1][player.x+1] = '0';
if(m->grid[player.y-1][player.x-1] != '1')
m->grid[player.y-1][player.x-1] = '0';
if(m->grid[player.y][player.x-1] != '1')
m->grid[player.y][player.x-1] = '0';
if(m->grid[player.y+1][player.x-1] != '1')
m->grid[player.y+1][player.x-1] = '0';
if(m->grid[player.y-1][player.x] != '1')
m->grid[player.y-1][player.x] = '0';
if(m->grid[player.y][player.x] != '1')
m->grid[player.y][player.x] = '0';
if(m->grid[player.y+1][player.x] != '1')
m->grid[player.y+1][player.x] = '0';
if(m->grid[player.y-1][player.x+1] != '1')
m->grid[player.y-1][player.x+1] = '0';
if(m->grid[player.y][player.x+1] != '1')
m->grid[player.y][player.x+1] = '0';
if(m->grid[player.y+1][player.x+1] != '1')
m->grid[player.y+1][player.x+1] = '0';
} else if (waittime > 100)
readFileMap(m, mapnumber);
}
......@@ -252,6 +270,7 @@ void renderMap(map *m, int time) {
renderChar(ext, i, j, offx, offy, 5);
break;
case('5'):
attron(COLOR_PAIR(6));
for (k = 0; k < 3; k++)
for (l = 0; l < 6; l++) {
if (k == 0)
......@@ -278,9 +297,9 @@ void renderMap(map *m, int time) {
case('6'):
if (m->grid[i][j+1] == '0')
m->grid[i][j] = 'f';
if (m->grid[i][j+1] == '6' && 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+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-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-1][j] == '0' && m->grid[i-1][j+1] == '0')
m->grid[i][j] = 'l';
for (k = 0; k < 3; k++)
......
......@@ -22,6 +22,10 @@ void updateRockford(rockford *player, map *m, int action, int done) {
m->grid[player->y][player->x] = '5';
player->diamonds++;
player->score += m->score;
} else if (right == '6' && m->grid[player->y+2][player->x] == '0') {
m->grid[player->y++][player->x] = '0';
m->grid[player->y][player->x] = '5';
m->grid[player->y+1][player->x] = '6';
}
} else if (action == 4) {
char left = m->grid[player->y-1][player->x];
......@@ -33,6 +37,10 @@ void updateRockford(rockford *player, map *m, int action, int done) {
m->grid[player->y][player->x] = '5';
player->diamonds++;
player->score += m->score;
} else if (left == '6' && m->grid[player->y-2][player->x] == '0') {
m->grid[player->y--][player->x] = '0';
m->grid[player->y][player->x] = '5';
m->grid[player->y-1][player->x] = '6';
}
} else if (action == 2) {
char down = m->grid[player->y][player->x+1];
......
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