Skip to main content
Inspiring
October 10, 2008
Answered

can hp bars effect MCs?

  • October 10, 2008
  • 2 replies
  • 367 views
this is my script
----------------------------------------------
onClipEvent(enterFrame){
this._xscale = _root.hp2;
if(_root.hp2<=-9){
_root.gotoAndStop(2)
}
}
---------------------------------------------

but I would like to put in a different action from "_root.gotoAndStop(2)" but that (and trace) seem to be the only things that work. Is there a special way of handling hp bars?

I would like a brick wall when struck by a cannon round to cause the hp bar to go down, and if the hp bar goes below zero, it commands the brick wall to delete from stage (remove) and removes itself. Alternatively, the brick wall switches or loads a pile of rubble and the undamaged looking one disappears.
This topic has been closed for replies.
Correct answer kglad
if you're having a problem with something not being removed, check its depth to make sure it's removable (ie, depth between 0 and 2**20) and check that your code is executing.

2 replies

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
October 10, 2008
if you're having a problem with something not being removed, check its depth to make sure it's removable (ie, depth between 0 and 2**20) and check that your code is executing.
kglad
Community Expert
Community Expert
October 10, 2008
use the removeMovieClip() method to remove your wall movieclip (assuming your wall is a movieclip).
shintashiAuthor
Inspiring
October 10, 2008
I've tried this: (code attached)

and instead of deleting the brick wall MC, the hp bar just goes into negatives.