I am wanting to detect if any key is being pressed but as far as I can tell the if statement isn't being triggered otherwise the program would shut down due to Enviroment.Exit(0).
public static int GameLoop()
{
while(true)
{
if(Console.KeyAvailable == true)
{
Environment.Exit(0); //test to see if being used
Player.KeyPressed = Console.ReadKey().KeyChar;
Player.Movement();
}
Console.WriteLine("working");
GameLoop() is being called because Console.WriteLine("working") is being executed. Any Ideas as to why Console.KeyAvailable == true isn't being met on key press? Thanks!
Aucun commentaire:
Enregistrer un commentaire