I am writing a text adventure in c# for a school assignment and I've already come across a problem.
I made a function to type out sentences like this:
public static void Zin (string zin)
{
foreach (char c in zin)
{
Console.Write(c);
Thread.Sleep(50);
}
Now this works but I want to implement that when the player hits the enter key, the sentence is typed out on the console instantly.
I'm not sure how to do this. I've tried using a while loop in the foreach loop that checks wether enter is being hit and then print out the sentence but that doesn't work.
Thanks in advance!