C# Class PlatformerPOC.Helpers.CamShaker

Camera shaker. Code example: http://xnaessentials.com/archive/2011/04/26/shake-that-camera.aspx
显示文件 Open project: bramdemoor/MonoGame-PlatformerPOC

Public Methods

Method Description
ShakeIfShaking ( Vector2 position, GameTime gameTime ) : Vector2
StartShaking ( float magnitude, float duration ) : void

Private Methods

Method Description
NextFloat ( ) : float

Helper to generate a random float in the range of [-1, 1].

Method Details

ShakeIfShaking() public static method

public static ShakeIfShaking ( Vector2 position, GameTime gameTime ) : Vector2
position Vector2
gameTime Microsoft.Xna.Framework.GameTime
return Vector2

StartShaking() public static method

public static StartShaking ( float magnitude, float duration ) : void
magnitude float
duration float
return void