need help changing health bar animation

Talk about making games.

should I post my game's tutorial (thats all i have so far), I'm never going to post the whole game, so it might be a tease.

yes definatly!
3
50%
i guess...
2
33%
no!
0
No votes
ur game probibly sucks, so it won't be a tease, put it on so we can laugh at it
1
17%
 
Total votes : 6

need help changing health bar animation

Postby cyber ruler » Sat Jul 14, 2007 12:56 am

I made a health bar with 8 animations, I want to include a health bar and health number. I can't get my health bar to change and match my hp number, cause for sum stupid reason g-e doesn't know wat equal to
( == ) means.

anyone know how i can do this?
cyber ruler
 
Posts: 52
Joined: Sat Apr 28, 2007 7:59 pm
Location: Je ne parle englais : /
Score: 0 Give a positive score

Re: need help changing health bar animation

Postby platformkid » Sat Jul 14, 2007 1:35 am

cyber ruler wrote:I made a health bar with 8 animations, I want to include a health bar and health number. I can't get my health bar to change and match my hp number, cause for sum stupid reason g-e doesn't know wat equal to
( == ) means.

anyone know how i can do this?


Hi, could you post the sample of the code that doesn't do what you want ?

Maybe the health number, when decreasing, doesn't reach the exact value
you're trying to match with the == comparison, but nonetheless continues
to decrease.

In the code that choses which of the 8 animations to display for the health
bar, maybe you should better use range tests like that (names and values
given as examples) :

Code: Select all
if ( (health < 10) && (health >= 8) )
{
    ChangeAnimation("Bar", "State2", FORWARD);

} else if ( ( health < 8) && (health >= 5) ) {

    ChangeAnimation("Bar", "State3", FORWARD);
}

// etc. etc.




Hope I understood your problem.

Good luck.
platformkid
 
Posts: 14
Joined: Sun Jul 01, 2007 1:25 am
Location: Paris, France
Score: 0 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest