Commit ce8413ff authored by Bruno Freitas Tissei's avatar Bruno Freitas Tissei
Browse files

Correções mapas

parent ee2311a8
......@@ -5,7 +5,7 @@
400 400 400
200 200 200
600 0 600
000BCKBA0000AA00000000000BFA000AAAAAA000
0000000000000000000000000000000000000000
1111111111111111111111111111111111111111
1222222022726022222626222222202222622221
1265622222202222222226722622220222220221
......
......@@ -18,7 +18,7 @@ char butterfly[3][6] = {"\\\\ //", " (__) ", "// \\\\"};
char explosion[3][6] = {" ", " ## ", " "};
char explosion2[3][6] = {"\\\\||//", "--##--", "//||\\\\"};
char explosion3[3][6] = {"#%$@%@", "#@ ##", "&@*@*#"};
char mapfile[2][100] = {"./sprites/map1.txt", "./sprites/map2.txt"};
char mapfile[3][100] = {"./sprites/map1.txt", "./sprites/map2.txt", "./sprites/map3.txt"};
int colors[7][3];
......@@ -120,7 +120,7 @@ void updateMap(map *m, int action) {
if (player.diamonds >= m->diamonds) {
m->score = 15;
done = true;
lightning = hold <= 30;
lightning = hold <= 8;
}
if (!dead) {
......@@ -164,6 +164,7 @@ void renderMap(map *m, int time) {
m->grid[3][0] = ((m->diamonds / 10) % 10) + 'A';
m->grid[4][0] = (m->diamonds % 10) + 'A';
m->grid[5][0] = 'K';
m->grid[6][0] = ((m->score / 10) % 10) + 'A';
m->grid[7][0] = (m->score % 10) + 'A';
......@@ -183,7 +184,7 @@ void renderMap(map *m, int time) {
m->grid[36][0] = (player.score % 10) + 'A';
if (done && player.x == extx && player.y == exty) {
if (time % 2 == 0 && leveltime != 0) {
if (leveltime != 0) {
leveltime--;
player.score++;
}
......@@ -192,6 +193,9 @@ void renderMap(map *m, int time) {
leveltime--;
}
if (lightning)
hold++;
for (i = 0; i < WIDTH; i++) {
for (j = 0; j < HEIGHT; j++) {
if (!dead)
......@@ -199,7 +203,6 @@ void renderMap(map *m, int time) {
switch (m->grid[i][j]) {
case('0'):
if (lightning) {
hold++;
renderChar(empty, i, j, offx, offy, 4);
} else
renderChar(empty, i, j, offx, offy, 6);
......
......@@ -53,7 +53,6 @@ int updateMenu(menu *menu, int action) {
currmap = (currmap + 1) % 5;
menu->grid[21][22] = mps[currmap];
break;
case 4:
currmap = currmap == 0 ? 4 : currmap - 1;
menu->grid[21][22] = mps[currmap];
......
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