Stats won't decrease over time.
Basically I have three stats, hunger thirst and temperature. They are supposed to be decreased by 1 point every second, and can be shown by pressing 'e'. The problem is that they will only go down by one point to 99, then stop. I've tried as much as I can think of but to no avail. Any help would be much appreciated.
This is happening because you are defining a new variable to hunger, thirst, and temperature when subtracting one. Also because x is 0, which evaluated to False and is not great when using `while loops. So what you have to do is this:
Also the last
if statement should be outside the while Loop.
Thanks, this worked for the most part aside from the stats not displaying when 'e' is pressed, it only displays when it is inside the loop, however at that point it only decreases the values every time 'e' is pressed. If you have any more advice on that it would be very helpful.
I see. my code doesn't work. And that is because python interprets code line by line. To actually decrease the stats, while letting the user play the game, you will need to use the threading module to actually run the code that decreases the stats in the background, while the user plays the game. Sorry for the late reply. @MatthewGilmour