-
Max Number Variable
EDIT: I already solved the healthbar problem. Now what I want to know is if there's a way to set a max number for my health. For example, when I click "heal", it goes way over the max HP which is 100. Is there a way to set the max number to 100? Thanks!
Last edited by vivyo; 11-24-2010 at 11:44 PM.
-
Senior Member
should heal just be health = 100?
like
heal_btn.onPress = function(){
health = 100;
}
or does each 'health' have different amounts/number it adds?
if yes.. then maybe:
heal_btn.onPress = function(){
health += (whatever amount you want here);
if( health > 100){
health = 100;
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|