Commit 89ded8ed authored by Bruno Freitas Tissei's avatar Bruno Freitas Tissei
Browse files

Fix Merge

parents 9442217e abc396c2
564
\ No newline at end of file
564
......@@ -46,30 +46,30 @@ void run(int ismenu, int running) {
int getInput() {
int input = getch();
if (input != ERR) {
switch (input) {
case KEY_UP:
return 8;
case KEY_DOWN:
return 2;
case KEY_RIGHT:
return 6;
case KEY_LEFT:
return 4;
case 10:
return 1;
case 27:
return 9;
default:
return 0;
}
}
return 0;
}
if (input != ERR) {
switch (input) {
case KEY_UP:
return 8;
case KEY_DOWN:
return 2;
case KEY_RIGHT:
return 6;
case KEY_LEFT:
return 4;
case 10:
return 1;
case 27:
return 9;
default:
return 0;
}
}
return 0;
}
void update(int action, int *ismenu) {
if (*ismenu) {
menuaction = updateMenu(&me, action);
void update(int action, int *ismenu) {
if (*ismenu) {
menuaction = updateMenu(&me, action);
if (menuaction != -1) {
load = true;
*ismenu = false;
......
......@@ -192,45 +192,18 @@ void updateMap(map *m, int action, int *ismenu) {
}
} else {
waittime++;
if (waittime < 21) {
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) {
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)
int k, l;
if (waittime < 21)
for(k = -1; k <= 1; k++)
for(l = -1; l <=1; l++)
if(m->grid[player.y+k][player.x+l] != '1')
m->grid[player.y+k][player.x+l] = 'x';
else if (waittime <= 100)
for(k = -1; k <= 1; k++)
for(l = -1; l <=1; l++)
if(m->grid[player.y+k][player.x+l] != '1')
m->grid[player.y+k][player.x+l] = '0';
else if (waittime > 100)
readFileMap(m, mapnumber, player.score);
}
}
......
......@@ -6,7 +6,7 @@ int offmenuy, offmenux;
int row, col;
char mps[5] = {'a', 'b', 'c', 'd', 'e'};
int currmap = 0;
int buffer = -1;
int buffer;
void readFileMenu(menu *menu) {
int i, j;
......@@ -46,6 +46,7 @@ void setMenuColors() {
int updateMenu(menu *menu, int action) {
buffer = -1;
switch(action){
case 6:
currmap = (currmap + 1) % 5;
......
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