applyAccelerationByAngle method
void
applyAccelerationByAngle(})
Implementation
void applyAccelerationByAngle(
double acceleration,
double angle, {
bool stopWhenSpeedZero = false,
bool updateAngleComponent = false,
double? initialSpeed,
VoidCallback? onStop,
}) {
_updateAngleComponent = updateAngleComponent;
_onStop = onStop;
_type = _TypeAcceleration.angle;
speed = initialSpeed ?? speed;
if (speed == 0) {
speed = 0.01;
}
_acceleration = Vector2.all(acceleration);
_stopWhenSpeedZero = stopWhenSpeedZero;
_moveAngle = angle;
if (_updateAngleComponent) {
this.angle = angle;
}
}