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