jump method

void jump({
  1. double? jumpSpeed,
  2. bool force = false,
})

Implementation

void jump({double? jumpSpeed, bool force = false}) {
  if (!isJumping || _currentJumps < _maxJump || force) {
    _currentJumps++;
    moveUp(speed: jumpSpeed ?? _defaultJumpSpeed);
    isJumping = true;
  }
}