OK, I need help with my healthbar.

Non-platform specific questions.

OK, I need help with my healthbar.

Postby Qsmash » Sun Oct 28, 2007 6:52 pm

My healthbar isn't supposed to go pass 20hp but when the player eats some more food it goes straight pass it. Can someone tell me what's wrong?
Image
User avatar
Qsmash
 
Posts: 23
Joined: Sun Sep 30, 2007 2:39 am
Score: 1 Give a positive score

Re: OK, I need help with my healthbar.

Postby DollMaster » Mon Oct 29, 2007 3:17 am

You need to do something like this:

if(health>healthmax)
health=healthmax;
DollMaster
 
Posts: 65
Joined: Fri Jun 16, 2006 2:38 am
Score: 2 Give a positive score

Re: OK, I need help with my healthbar.

Postby Kalladdolf » Mon Oct 29, 2007 10:23 am

I think I have a turtorial about that.
U'll have to wait till I get home.
Check out my caverunner in the game demo section, I used a healthbar there.

Edit: Uh, I thought u were talkin' about a visual health bar... never mind, DollMaster covered it. :D
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron