I am currently making my first console game to challenge myself but I am getting stumped on a couple of things. Please ignore my empty voids as I want to attempt those before I ask for help on those. My first question is on lines 11-18, what I'm trying to do is get the current health and attack but if I use void and try to get the current that way instead of the return then on lines 81 and 82 I get errors (I'm not sure at the moment); I'm trying to get your current health/attack and print it on lines 81 and 82. Do I have to move the health and attack text box to game.update()? Since this is my first game is there any pointers to what I can improve on in my current code (besides the blank voids and unused voids at the moment), is there parts of code were I need to change/remove? Any criticism you have will help me out, so please tell me your thoughts.
Do you mean things like character.player_attack() and game.begin()? I tested my code last night and it did start and displayed the right things it was supposed to. I didn't think that declaring game as game and character as character would do anything but allow me to understand. I am still stumped on my original questions.
After I added #include <string> after your other include, I was able to print out the map in the draw() function, along with the current Health (10), and Attack (3) values. Of course, the program then ends, as there is no inputs, etc., to make movements and such.
Did you change the current health and attack functions or did you just add #include <string> ? I am able to print everything out without #include <string> . I haven't gotten that far into the game yet obviously, all that I was worried about last night was getting the display up and building the game without any errors and not worrying about the user input just yet.
No, i didn't change anything else, just added the include. I'm using MS Visual C++ Express 2012, so needed the include. Not sure what compiler you have. Anyway, I was able to show the maze, with the health and attack variables sowing under it. I added in a character movement in my program. Right now, I'm not checking for walls, etc., but that will be next. As long as this isn't a school project, I'll be glad to help out, if you would like. Send me a PM, and we can collaborate on it.