I'm making a text-based game. I'm trying to have a little "health bar". When the user hit space, and when the button is pressed it will make health go up by 5, but while this is also happening I need something to be running in the background that is doing the same as if it was a AI, except I want it to subtract 1 every time and for it to only hit it once every second.
I tried getch();
the most but the problem with that is that it stops everything and waits for the user to use a input so nothing can be going on in the background that is subtracting health.
If you could use the _getch();
command in any way to accomplish this, because I already know how to use it well.