Negative numbers in integer attribute problem.
DanielDoe
Member Posts: 307
Is there a way to keep integer attribute always positive or equal 0 (e.x. 5-10=0)? I thought that integer is always positive, but during a game I realized that it gets negative numbers as well. In my game I have simple leveling system. When you progress (higher player level) you gain less points for killing enemies, but you kill them much easier.
MyLevelProgress=MyLevelProgress+(MonsterScore-PlayerLevel)
If the killed monster with score=5 and my players current level=10 I get -5 which makes the progress of payer impossible.
MyLevelProgress=MyLevelProgress+(MonsterScore-PlayerLevel)
If the killed monster with score=5 and my players current level=10 I get -5 which makes the progress of payer impossible.
Answers