Alright, so I am still very new to C++ and this is one of my first project with that language. I am posting it here to get some feedback if possible to know what I should of maybe done, or if this is alright.
Now I didn’t use classes, …on purpose. I have not really covered that yet in C++ syntax and I have no clue on how to use constructors yet and pointers still confuse me a little. I come from C#, so I do know that wrapping this in a Game object would of made more sense than a namespace.
So this is a map generator made mostly for rogue style RPGs. However, in reality, you could use a Sprite sheet and use it for something else. I wanted to do something different then the usually random dungeon generator, so I made a town generator instead. It creates random size houses at random location without any overlap and with a door at a random location.
#include <cstdlib>
#include <iostream>
#include <ctime>
#include <windows.h>
#include "MapGen.h"
usingnamespace std;
usingnamespace Generator;
int main()
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0x07);
cout << "\nStart of application" << endl;
srand(time(0));
while (true)
{
// ** Normaly Create() would be outside of the game loop.
// but for the sake of testing, its in the loop.
Create();
// This will draw the map.
Draw();
COORD end = { 0, 34 };
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), end );
cout << "Press Enter to Continue" << endl;
cin.ignore(100, '\n');
}
return 0;
}