Hello everyone.
Does anybody know how to write a function for checking all variables in the game and prevent them from going below the 0?
Here are a couple of variables from my game:
And after some choices players can decrease some of them even below zero. And I don't want that.
I've found one solution that works, but I have to use it every time I want to decrease the value.
I'm pretty sure there's a better and more elegant way to check ALL variables and prevent them from going below the 0.
Hope someone knows how Thanks.
Does anybody know how to write a function for checking all variables in the game and prevent them from going below the 0?
Here are a couple of variables from my game:
Python:
default s_alpha = 0
default s_beta = 0
default s_chloe = 0
I've found one solution that works, but I have to use it every time I want to decrease the value.
Python:
$ s_alpha = max(0, points-1)
Hope someone knows how Thanks.