velocity property

Vector2 get velocity
inherited

Implementation

Vector2 get velocity => _velocity;
set velocity (Vector2 newVelocity)
inherited

Implementation

set velocity(Vector2 newVelocity) {
  _velocity = newVelocity;
  if (!_velocity.isZero()) {
    direction = _getDirectionFromVelocity(_velocity);
  }
}