using System.Speech.Synthesis;
public static void Main(string[] args)
Console.CursorVisible = false;
SpeechSynthesizer speech = new SpeechSynthesizer();
Random rnd = new Random();
int _enemyX = rnd.Next(5, Console.WindowWidth - 5);
int _enemyY = rnd.Next(5, Console.WindowHeight - 5);
Console.ForegroundColor = ConsoleColor.Red;
Console.SetCursorPosition(_enemyX, _enemyY);
Console.ForegroundColor = ConsoleColor.DarkYellow;
Console.SetCursorPosition(_x, _y);
Console.ForegroundColor = ConsoleColor.DarkYellow;
Console.SetCursorPosition(_bulletX, _bulletY);
Console.SetCursorPosition(_x, _y);
Console.SetCursorPosition(_bulletX, _bulletY);
if (_bulletX >= Console.WindowWidth) _bulletVisible = false;
if (Console.KeyAvailable)
ConsoleKeyInfo keyInfo = Console.ReadKey(true);
if (keyInfo.Key == ConsoleKey.W) _y--;
if (keyInfo.Key == ConsoleKey.S) _y++;
if (keyInfo.Key == ConsoleKey.D) _x++;
if (keyInfo.Key == ConsoleKey.A) _x--;
if (keyInfo.Key == ConsoleKey.Spacebar && !_bulletVisible)
speech.SpeakAsync("pew");
if (_enemyX == _bulletX + 2 && _enemyY == _bulletY)
speech.SpeakAsync("BOOM");
while (_x >= 0 && _y >= 0 && _x < Console.WindowWidth && _y < Console.WindowHeight && hit != true);
Console.SetCursorPosition(Console.WindowWidth/2, Console.WindowHeight/2);
Console.WriteLine("You Won!!!!");
static int _x = Console.WindowWidth / 2;
static int _y = Console.WindowHeight / 2;
static bool _bulletVisible;