Page 1 of 1

Decrease a variable

PostPosted: Thu Apr 12, 2007 9:29 am
by littlekruser
I'd like to decrease a variable by 1 until it reaches zero. The var is called "hunger" and is used for people in my game. I want it to be set to 100 and then decrease at a steady rate down to 0. I've tried as many ways as I can think of, so any help would be much appreciated!

PostPosted: Thu Apr 12, 2007 1:05 pm
by makslane
Code: Select all
hunger = hunger - 1;


or

Code: Select all
hunger -= 1;


or

Code: Select all
hunger--;