I want to make small animation in a c++ console application. I move only one character so system("cls")
and print out the changed string. This takes a long time and is unnecessary for moving one character so i was wondering if there is a function that lets you manually change the character at a certain location. I would prefer a cross platform option but i doubt there is one so if you could provide Linux and Windows or just Windows that's fine.
I have a method to clear the console and re-print everything after changing the position of the character but it is quite unpleasant to watch.
for (int x = 0; x < 15; x++) {
system("cls");
print_galaxy_with_spaceship(galaxies.at(0), player);
player.move(x, 0);
sleep(10);
}
I want a smooth changing of characters to show movement but there is a clear distortion when watching the characters re-print.