This code shows result like:
distance from target : 10
distance from target : 9
distance from target : 8
(line by line)
I want to show the result like- distance from target : 10, then 9,8,7 replacing the place of 10, (only the place of 10 will update)
public void Attack()
{
for (int i = 1; i < 3; i++)
{
if (i == 1)
{
Console.WriteLine("Target Locked (+)");
Thread.Sleep(2000);
}
if (i == 2)
{
Console.WriteLine("Fired!");
Thread.Sleep(1000);
}
}
Random random = new Random();
int distance = random.Next(100, 3000);
for (int i = distance; i > 0; i = i - 3)
{
Console.WriteLine("distance from target : " + i);
Thread.Sleep(30);
//Console.Clear();
}
Console.WriteLine("BloooW!");
}