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.
Printable View
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.
Use this:
It will only take 1 health. Move away from enemy and hit him again to reduce 1 point again.Code:if (this.hitTest(_root.enemy)) {
if (hitting<>1) {
hitting = 1;
_root.health -= 1;
}
} else {
hitting = 0;
}
ooh, what does that operator do <> ?
<> is same as not equal.
Flash4 habbit of mine, not to worry, it still works :)