Skip to content
Permalink
Browse files
Render chests in maze (Implements #4)
Chests now rendered in maze.
Added image with windows console color codes
  • Loading branch information
Andre Silva (mateussa) committed Jan 26, 2018
1 parent 3487bea commit fd7bbc6c177426cdb0733d8292e5af2e40188c2e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -7,6 +7,7 @@
#include <vector>
#include <time.h>
#include <algorithm>
#include <windows.h>

/**
* Constructor.
@@ -182,14 +183,23 @@ void Maze::printMaze() {
for(int w = 0; w < m_width; w++) {
/* Print maze to console
0: Path > 32
1: Wall > 219 */
1: Wall > 219
3: Chest > 219 Yellow*/
switch (m_maze[w][h]){
default:
case 0:
std::cout << (char)32 << (char)32;
break;
case 1:
std::cout << (char)219 << (char)219;
break;
case 3:
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14);
std::cout << (char)219 << (char)219;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
break;
default:
std::cout << m_maze[w][h] << m_maze[w][h];
break;
}
}
}

0 comments on commit fd7bbc6

Please sign in to comment.