I am coding a RPG python game battle system, my objective is that every time I take damage, my HP reduces and its updates as soon as I take damage without re-printing the HP bar. Can the HP bar, which is already printed on the top of the console, update simultaneously or replace the old HP bar at the same position (top of the console) instead of printing a separate updated HP bar at the bottom?
Asked
Active
Viewed 51 times
0
-
1This needs some additional library like "curses" or a more simple library to control the terminal. – Michael Butscher Feb 26 '22 at 21:29
-
1Also requires a terminal/console that supports curses (i.e. ANSI escape sequences). – martineau Feb 26 '22 at 22:02
-
What about [this](https://stackoverflow.com/questions/5419389/how-to-overwrite-the-previous-print-to-stdout-in-python)? Search for related topics like this. There are many details discussed in this field. – Shayan Feb 26 '22 at 22:26