ok, so think with me:
1- you'll need your Tile* all the time while the map is being drawn, so don't put it inside a simple function. move it to inside the Game class, so you can access it later (and when things get bigger, you'll probably want a GameMap class or something like that).
2- inside your TextureManager.h, you could use a enum with tile types, like
enum TileNames{Plain, Water, Etc};
instead of passing string to the TextureManager constructor. then, in TextureManager.cpp, you could use a switch/case instead of many if/else cases.
3- on top of everything, this is your game loop inside Game.cpp (I added comments):
while(renderWindow.isOpen()) { //while window is open
while (renderWindow.pollEvent(event)){ //and while there are events to run
if(event.type==sf::Event::Closed) //if this event is "window.close"
renderWindow.close(); //close the game window
}
renderWindow.clear(); //clear the game window (if its no closed, of course)
renderWindow.display(); // display what have been drawn on game window
}
the problem is, you haven't drawn anything to the renderWindow! you should call something like
renderWindow.draw(tile)
before renderWindow.display() and after renderWindow.clear();
more info on how that works.4- and finally, have a look on the game class:
class Game {
public:
sf::RenderWindow renderWindow;
Game();
void generateMap();
};
there is no map inside it. just a renderWindow. so you really can't draw anything...
move the Tile* inside the Game class, make the adjustments I said, and try again. probably will not work yet, but lets get going. ah, a good idea would be using
std::vector<Tile> tiles
instead of
Tile* tile
. vectors are like arrays, but much better to handle.
to be honest, i think you should start from zero. don't try to make a game from scratch; and it seems to me that you are using the SFML book to creating a game, which is very confusing to newbies.
instead, try creating pieces of game. use a project to create a TileMap, another to create pathfinding, another to create some kind of procedural terrain generator... this way you can keep things simple.