SpriteBaseLimitVelocity Method |
Namespace: (Default Namespace)
public virtual void LimitVelocity( int Maximum )
The speed of the sprite is calculated with the distance formula, so a sprite moving 3 pixels horizontally and 4 pixels vertically, for example, is considered to be moving 5 pixels.
If the sprite is riding a platform, the maximum velocity is applied relative to the platform. For example, if the platform is moving rightward at 3 pixels per frame, and the sprite is moving rightward at 5 pixels per frame relative to the platform (8 pixels per frame in absolute terms), and the maximum is set to 4 pixels per frame, the sprite's LocalDX will be reduced to 4 rather than to 1
.