Author |
Message |
bowser guy
Joined: Tue Oct 28, 2008 1:37 pm Posts: 300
|
this is how i make my health bar decrease i want to know how to make my character go to the dead animation when the x scale is 0 and the health bar unload anyone
_________________super smash bros blits(working title)-1% done new flash game
|
Mon May 04, 2009 9:32 am |
|
|
Evilagram
Joined: Wed Apr 29, 2009 11:28 pm Posts: 323 Location: Nowhere, Antarctica
Gender: Anime Girl
Skype: Evilagram
|
Changes put in bold. Try using a health variable, and syncing that to the bar, not changing the bar's value itself. _root.healthBar._xscale = CurrentHealth / MaxHealth * 100;
_________________Style [Stayl] (n) - One's unique and personal method of defacing a perfectly good piece of paper. READ THIS: http://ipgd.freehostia.com/copypasta.html
|
Mon May 04, 2009 9:47 am |
|
|
bowser guy
Joined: Tue Oct 28, 2008 1:37 pm Posts: 300
|
im a bit confused your code didn't work so i had to edit it but it still dosnt work what exactly will the changes what you did do
_________________super smash bros blits(working title)-1% done new flash game
|
Mon May 04, 2009 10:29 am |
|
|
Evilagram
Joined: Wed Apr 29, 2009 11:28 pm Posts: 323 Location: Nowhere, Antarctica
Gender: Anime Girl
Skype: Evilagram
|
HA HA HA, I FORGOT THAT YOU CAN'T PUT s*** IN BOLD FOR CODE TAGS. Also, what I meant was using that code I posted to update the bar. As in, make a current and max health variable, then in the hittest thing just do this
_________________Style [Stayl] (n) - One's unique and personal method of defacing a perfectly good piece of paper. READ THIS: http://ipgd.freehostia.com/copypasta.html
|
Mon May 04, 2009 10:36 am |
|
|
bowser guy
Joined: Tue Oct 28, 2008 1:37 pm Posts: 300
|
ok ive managed to make that code work (dont know the difference) but what i realy want is it to stop when the x scale is 0 and my char to go to his dead animation
_________________super smash bros blits(working title)-1% done new flash game
|
Mon May 04, 2009 11:04 am |
|
|
Evilagram
Joined: Wed Apr 29, 2009 11:28 pm Posts: 323 Location: Nowhere, Antarctica
Gender: Anime Girl
Skype: Evilagram
|
_________________Style [Stayl] (n) - One's unique and personal method of defacing a perfectly good piece of paper. READ THIS: http://ipgd.freehostia.com/copypasta.html
|
Mon May 04, 2009 11:13 am |
|
|
bowser guy
Joined: Tue Oct 28, 2008 1:37 pm Posts: 300
|
ive tryed to stitch all the codes together but here are the problems
_________________super smash bros blits(working title)-1% done new flash game
|
Mon May 04, 2009 11:34 am |
|
|
x2i
Joined: Mon Aug 11, 2008 1:09 pm Posts: 166 Location: England lol
Gender: Male
Currently Playing: Minecraft
|
Isn't this supposed to have }'s instead of ('s and )'s to end an if statement... you failed to correct that and have seemed to adopt that method of doing it in every code amendment.
|
Mon May 04, 2009 11:38 am |
|
|
Evilagram
Joined: Wed Apr 29, 2009 11:28 pm Posts: 323 Location: Nowhere, Antarctica
Gender: Anime Girl
Skype: Evilagram
|
That won't work. The variables need to be declared on the frame itself. Otherwise it'll just set them to 10 every frame. That, and you stuck onClipEvent handlers inside of other onClipEvent handlers. I went into flash and debugged the thing myself. Move the currenthealth and maxhealth variable to the frame itself and use this code.
_________________Style [Stayl] (n) - One's unique and personal method of defacing a perfectly good piece of paper. READ THIS: http://ipgd.freehostia.com/copypasta.html
|
Mon May 04, 2009 11:46 am |
|
|