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