Health bar not working, other threads not helping.

7 posts

Flag Post

Welp, my health bar isnt working, heres the low down.

I made the healthMeter movie clip, a black empty rectangle, everything named correctly and whatnot. Then inside on, on a different layer, made healthMeterBar, a green rectangle, with an instance name of “bar”, everything else named correctly. Like it said in the previous threads, I did not tick “Export for AS”.

in my Ship.as under the onLoad() function I set health = 100; and created var health.

then in the enemymissile.as, this nice little snippet.

function onEnterFrame()
{
_x += speed;

if(this.hitTest( _root.ship))
{
this.removeMovieClip();
_root.ship.updateHealth(-10);
}

However, my health bar still refuses to to decrease when hit by a missile, under the hitTest I also told it to trace “banana boat” however that was not put into the output section when a missle hit, meaning that code is not connecting at all.

Halp, here is where you can download all of my files and game, I hope someone can help, its a project for school and Ive been breaking my balls to fix this problem.

http://www.megaupload.com/?d=2TT2C8DX

 
Flag Post

Carn fellas, Iv’e tried absolutely everything in all the other health bar related threads I could find on the subforum, and time is my blood, I’ll be forever in the persons debt, forever, not that I’m rushing anyone along if they ARE doing something, oh no, dohohoho silly me.

PLEASE

poke

 
Flag Post

From your description it doesn’t sound like the health bar is a problem. If the hitTest isn’t working at all, then you can’t blame the health bar for not changing (since it only changes if the hitTest is true).

Check that your ship is properly set up, because that seems more likely to be where the problem is. Make sure its properly exported for AS as needed, that it’s definitely ship and not Ship, and so on.

 
Flag Post

Well, I did have “Ship” instead of “ship” but that shouldnt matter as all the things relating to health are directed towards “Ship” not “ship”

 
Flag Post

Here is an updated version of my files, fixing a few “Ship” issues, however health still doesnt work.

http://www.megaupload.com/?d=VXB6L23R

 
Flag Post

Holy hell, i know this is whining but I REALLY NEED someone to at least take a gander at my code and see if they can find anything wrong. I’m not some guy who whines to the forums on the first sign of a problem, I have literally gone through every bloody thign I CAN THINK OF, and nothing is working its really frustrating and 50% of my grade is on the line! FFFFFFFFFFFF-

 
Flag Post

I’m having the same problem.