removeLife method

void removeLife(
  1. double life
)

reduce life

Implementation

void removeLife(double life) {
  if (_life > 0) {
    _life -= life;
  }
  if (_life <= 0 && !_isDead) {
    die();
  }
}