因此,我正在制作一个基本的Zork控制台应用程序游戏。门每次随机化(尚未完成),玩家必须猜测哪个门通过,只有一个门允许通过。然而,为了让用户类型更快,我想用倒数计时器给他们的墙壁上的幻觉,如果他们没有输入任何东西,然后达到零他们'被杀死',但我无法弄清楚如何添加一个倒数计时器,但也有控制台检查用户有关移动的输入。这是我目前的代码,并且记住它尚未完成。在不禁用用户输入的情况下添加倒计时器
using System;
using System.Threading;
namespace Prog4
{
class program
{
public static void Main(string[] args)
{
Random random = new Random();
int north = random.Next(1,5);
int south = random.Next(1,5);
int east = random.Next(1,5);
int west = random.Next(1,5);
Console.WriteLine("You are in a room that is slowly closing in on you, it has only four exits." + Environment.NewLine +
"The four exits face: North, South, East and West. " + Environment.NewLine +
"Use n for North, s for South, e for East and w for West" + Environment.NewLine +
"Only one exit leads to outside, the rest lead to certain doooooooooooooom");
}
}
}
玩我的答案[这里](http://stackoverflow.com/a/16973768/2330053)和[这里](http://stackoverflow.com/a/16907575/2330053)的一些想法如何做这个。 –