public static Timer aTimer;
public static int startX = 0;
public static int startY = 0;
public static int endX = -10;
public static int endY = 15;
public static int currentX = startX;
public static int currentY = startY;
public static void Main()
aTimer = new System.Timers.Timer();
aTimer.Elapsed += OnTimedEvent;
Console.WriteLine($"Started at: {startX}, {startY}");
Console.WriteLine($"Aiming for: {endX}, {endY}");
private static void OnTimedEvent(Object source, System.Timers.ElapsedEventArgs e)
if (endX < currentX) currentX--;
else if (endX > currentX) currentX++;
if (endY < currentY) currentY--;
else if (endY > currentY) currentY++;
Console.WriteLine($"{currentX}, {currentY}");
if (currentX == endX && currentY == endY) aTimer.Stop();