shake() static private method

Shake the screen
static private shake ( float Intensity = 0.025f, float Duration = 0.5f, System.Action OnComplete = null, bool Force = true, uint Direction ) : void
Intensity float
Duration float
OnComplete System.Action
Force bool
Direction uint
return void
Example #1
0
 /// <summary>
 /// Simple Controller vibration
 /// </summary>
 /// <param name="Duration">The length in seconds the vibration should last</param>
 /// <param name="IntensityLeftMotor">The intensity of the Left Motor vibration</param>
 /// <param name="IntensityRightMotor">The intensity of the Right Motor vibration</param>
 /// <param name="ShakeScreen">Should the screen shake in unison with the controller vibration</param>
 public void vibrate(float Duration = 0.5f, float IntensityLeftMotor = 0.15f, float IntensityRightMotor = 0.15f, bool ShakeScreen = false)
 {
     vibeDuration = Duration;
     leftVibe     = IntensityLeftMotor;
     rightVibe    = IntensityRightMotor;
     if (ShakeScreen)
     {
         FlxG.shake(IntensityLeftMotor / 20, Duration);
     }
 }