Click or drag to resize
SpriteBaseReactToInertia Method
Reduces the sprite's velocity to simulate friction.

Namespace: (Default Namespace)
Assembly: Default (in Default.exe) Version: 1.0.0.0
Syntax
C#
public virtual void ReactToInertia(
	int RetainPercentVertical,
	int RetainPercentHorizontal
)

Parameters

RetainPercentVertical
Type: SystemInt32
What percent (0 to 100) of the sprite's horizontal velocity (dx) is retained.
RetainPercentHorizontal
Type: SystemInt32
What percent (0 to 100) of the sprite's vertical velocity (dy) is retained.
Remarks
Note that inertia may have unexpected side-effects on gravity. For example, if RetainPercentVertical is set to zero, this will cause the sprite to start from a vertical velocity of 0 on every frame, which will result in gravity being unable to accumulate any effect. It's best to set RetainPercentVertical to a high number or 100 when gravity is in effect. A gravity effect is simply an automatic adjustment to the Y velocity with AlterYVelocity(Double).
See Also