I need help with this. The grey box's 'health' should only minus 1 'point' off the health when it collides with the red box. But instead, the health went all down. I need the 'health' to just stop minusing 1 health point and stop.
stuff
Use this: Code: if (this.hitTest(_root.enemy)) { if (hitting<>1) { hitting = 1; _root.health -= 1; } } else { hitting = 0; } It will only take 1 health. Move away from enemy and hit him again to reduce 1 point again.
if (this.hitTest(_root.enemy)) { if (hitting<>1) { hitting = 1; _root.health -= 1; } } else { hitting = 0; }
My games, Tile based tutorials, Vectors, Latest update - fastazzi
ooh, what does that operator do <> ?
http://www.matthewbenney.co.uk/ | http://blog.matthewbenney.co.uk/
<> is same as not equal. Flash4 habbit of mine, not to worry, it still works
Forum Rules