public void target(Char ch) { if (ch != null && ch.isAlive()) { target = ch; } else { target = null; } }
@Override public void update() { super.update(); if (target != null && target.isAlive() && target.sprite.visible) { CharSprite sprite = target.sprite; bg.scale.x = sprite.width; level.scale.x = sprite.width * target.HP / target.HT; bg.x = level.x = sprite.x; bg.y = level.y = sprite.y - HEIGHT - 1; visible = true; } else { visible = false; } }