Hey everyone, first board post here. Taking my first c++ class and i need help with my dungeon crawler i am building. So far i have my character movement set up to take in a string press enter and move depending on string entered. I want to use just the WASD keys, which i have it set up for but the user needs to hit enter afterwards. So this noob needs to know how to get around this problem. So i have
string input
if (input=="w")
Preform my code through the array to play the game.
I saw the input=getch(); somewhere online i don't know exactly what it does though.
Any help or references are greatly appreciated. Needs to be all console based.
Just learned about this one today. getch(); captures one key stroke and you dont need to press enter. we made a rock paper scissors program, if u want the code i can give it to you
Thanks for the help everyone. I ended up using the switch statement since when i was declaring char x then setting x=getch(); it was saying it had no stored variable type.